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

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

Issue 2524363003: Support experiment configurations with/without stability metrics. (Closed)
Patch Set: 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
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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 SendStagedLog(); 907 SendStagedLog();
908 } 908 }
909 if (is_cellular_logic) { 909 if (is_cellular_logic) {
910 UMA_HISTOGRAM_BOOLEAN("UMA.LogUpload.Canceled.CellularConstraint", 910 UMA_HISTOGRAM_BOOLEAN("UMA.LogUpload.Canceled.CellularConstraint",
911 upload_canceled); 911 upload_canceled);
912 } 912 }
913 } 913 }
914 914
915 bool MetricsService::ProvidersHaveInitialStabilityMetrics() { 915 bool MetricsService::ProvidersHaveInitialStabilityMetrics() {
916 // Check whether any metrics provider has initial stability metrics. 916 // Check whether any metrics provider has initial stability metrics.
917 for (MetricsProvider* provider : metrics_providers_) { 917 bool has_stability_metrics = false;
918 if (provider->HasInitialStabilityMetrics()) 918 for (MetricsProvider* provider : metrics_providers_)
919 return true; 919 has_stability_metrics |= provider->HasInitialStabilityMetrics();
Alexei Svitkine (slow) 2016/11/24 21:27:58 Please add a comment above why this doesn't do an
bcwhite 2016/11/25 18:51:58 Done.
920 }
921 920
922 return false; 921 return has_stability_metrics;
923 } 922 }
924 923
925 bool MetricsService::PrepareInitialStabilityLog( 924 bool MetricsService::PrepareInitialStabilityLog(
926 const std::string& prefs_previous_version) { 925 const std::string& prefs_previous_version) {
927 DCHECK_EQ(INITIALIZED, state_); 926 DCHECK_EQ(INITIALIZED, state_);
928 927
929 std::unique_ptr<MetricsLog> initial_stability_log( 928 std::unique_ptr<MetricsLog> initial_stability_log(
930 CreateLog(MetricsLog::INITIAL_STABILITY_LOG)); 929 CreateLog(MetricsLog::INITIAL_STABILITY_LOG));
931 930
932 // Do not call NotifyOnDidCreateMetricsLog here because the stability 931 // Do not call NotifyOnDidCreateMetricsLog here because the stability
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 base::Time::Now().ToTimeT()); 1225 base::Time::Now().ToTimeT());
1227 } 1226 }
1228 1227
1229 void MetricsService::SkipAndDiscardUpload() { 1228 void MetricsService::SkipAndDiscardUpload() {
1230 log_manager_.DiscardStagedLog(); 1229 log_manager_.DiscardStagedLog();
1231 scheduler_->UploadCancelled(); 1230 scheduler_->UploadCancelled();
1232 log_upload_in_progress_ = false; 1231 log_upload_in_progress_ = false;
1233 } 1232 }
1234 1233
1235 } // namespace metrics 1234 } // namespace metrics
OLDNEW
« components/metrics/file_metrics_provider.cc ('K') | « components/metrics/file_metrics_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698