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

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

Issue 1985733002: Always check if providers have initial stability metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed order of test expectations Created 4 years, 7 months 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 | « no previous file | components/metrics/metrics_service_unittest.cc » ('j') | 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 session_id_ = local_state_->GetInteger(prefs::kMetricsSessionID); 584 session_id_ = local_state_->GetInteger(prefs::kMetricsSessionID);
585 585
586 if (!clean_exit_beacon_.exited_cleanly()) { 586 if (!clean_exit_beacon_.exited_cleanly()) {
587 IncrementPrefValue(prefs::kStabilityCrashCount); 587 IncrementPrefValue(prefs::kStabilityCrashCount);
588 // Reset flag, and wait until we call LogNeedForCleanShutdown() before 588 // Reset flag, and wait until we call LogNeedForCleanShutdown() before
589 // monitoring. 589 // monitoring.
590 clean_exit_beacon_.WriteBeaconValue(true); 590 clean_exit_beacon_.WriteBeaconValue(true);
591 } 591 }
592 592
593 bool has_initial_stability_log = false; 593 bool has_initial_stability_log = false;
594 bool providers_have_initial_stability_metrics =
595 ProvidersHaveInitialStabilityMetrics();
594 if (!clean_exit_beacon_.exited_cleanly() || 596 if (!clean_exit_beacon_.exited_cleanly() ||
595 ProvidersHaveInitialStabilityMetrics()) { 597 providers_have_initial_stability_metrics) {
596 // TODO(rtenneti): On windows, consider saving/getting execution_phase from 598 // TODO(rtenneti): On windows, consider saving/getting execution_phase from
597 // the registry. 599 // the registry.
598 int execution_phase = 600 int execution_phase =
599 local_state_->GetInteger(prefs::kStabilityExecutionPhase); 601 local_state_->GetInteger(prefs::kStabilityExecutionPhase);
600 UMA_HISTOGRAM_SPARSE_SLOWLY("Chrome.Browser.CrashedExecutionPhase", 602 UMA_HISTOGRAM_SPARSE_SLOWLY("Chrome.Browser.CrashedExecutionPhase",
601 execution_phase); 603 execution_phase);
602 604
603 // If the previous session didn't exit cleanly, or if any provider 605 // If the previous session didn't exit cleanly, or if any provider
604 // explicitly requests it, prepare an initial stability log - 606 // explicitly requests it, prepare an initial stability log -
605 // provided UMA is enabled. 607 // provided UMA is enabled.
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 base::Time::Now().ToTimeT()); 1195 base::Time::Now().ToTimeT());
1194 } 1196 }
1195 1197
1196 void MetricsService::SkipAndDiscardUpload() { 1198 void MetricsService::SkipAndDiscardUpload() {
1197 log_manager_.DiscardStagedLog(); 1199 log_manager_.DiscardStagedLog();
1198 scheduler_->UploadCancelled(); 1200 scheduler_->UploadCancelled();
1199 log_upload_in_progress_ = false; 1201 log_upload_in_progress_ = false;
1200 } 1202 }
1201 1203
1202 } // namespace metrics 1204 } // namespace metrics
OLDNEW
« no previous file with comments | « no previous file | components/metrics/metrics_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698