Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: components/metrics/metrics_service.cc

Issue 2524363003: Support experiment configurations with/without stability metrics. (Closed)
Patch Set: move experiment check into FileMetricsProvider Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/metrics/file_metrics_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Description of the life cycle of a instance of MetricsService. 6 // Description of the life cycle of a instance of MetricsService.
7 // 7 //
8 // OVERVIEW 8 // OVERVIEW
9 // 9 //
10 // A MetricsService instance is typically created at application startup. It is 10 // A MetricsService instance is typically created at application startup. It is
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 SendStagedLog(); 909 SendStagedLog();
910 } 910 }
911 if (is_cellular_logic) { 911 if (is_cellular_logic) {
912 UMA_HISTOGRAM_BOOLEAN("UMA.LogUpload.Canceled.CellularConstraint", 912 UMA_HISTOGRAM_BOOLEAN("UMA.LogUpload.Canceled.CellularConstraint",
913 upload_canceled); 913 upload_canceled);
914 } 914 }
915 } 915 }
916 916
917 bool MetricsService::ProvidersHaveInitialStabilityMetrics() { 917 bool MetricsService::ProvidersHaveInitialStabilityMetrics() {
918 // Check whether any metrics provider has initial stability metrics. 918 // Check whether any metrics provider has initial stability metrics.
919 for (MetricsProvider* provider : metrics_providers_) { 919 // All providers are queried (rather than stopping after the first "true"
920 if (provider->HasInitialStabilityMetrics()) 920 // response) in case they do any kind of setup work in preparation for
921 return true; 921 // the later call to RecordInitialHistogramSnapshots().
922 } 922 bool has_stability_metrics = false;
923 for (MetricsProvider* provider : metrics_providers_)
924 has_stability_metrics |= provider->HasInitialStabilityMetrics();
923 925
924 return false; 926 return has_stability_metrics;
925 } 927 }
926 928
927 bool MetricsService::PrepareInitialStabilityLog( 929 bool MetricsService::PrepareInitialStabilityLog(
928 const std::string& prefs_previous_version) { 930 const std::string& prefs_previous_version) {
929 DCHECK_EQ(INITIALIZED, state_); 931 DCHECK_EQ(INITIALIZED, state_);
930 932
931 std::unique_ptr<MetricsLog> initial_stability_log( 933 std::unique_ptr<MetricsLog> initial_stability_log(
932 CreateLog(MetricsLog::INITIAL_STABILITY_LOG)); 934 CreateLog(MetricsLog::INITIAL_STABILITY_LOG));
933 935
934 // Do not call NotifyOnDidCreateMetricsLog here because the stability 936 // Do not call NotifyOnDidCreateMetricsLog here because the stability
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 base::Time::Now().ToTimeT()); 1229 base::Time::Now().ToTimeT());
1228 } 1230 }
1229 1231
1230 void MetricsService::SkipAndDiscardUpload() { 1232 void MetricsService::SkipAndDiscardUpload() {
1231 log_manager_.DiscardStagedLog(); 1233 log_manager_.DiscardStagedLog();
1232 scheduler_->UploadCancelled(); 1234 scheduler_->UploadCancelled();
1233 log_upload_in_progress_ = false; 1235 log_upload_in_progress_ = false;
1234 } 1236 }
1235 1237
1236 } // namespace metrics 1238 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/file_metrics_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698