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

Unified Diff: components/metrics/metrics_service.cc

Issue 1891913002: Support saving browser metrics to disk and reading them during next run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove DCHECK_IS_ON from .h files because it's not always defined and don't want to add the include Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/metrics_service.cc
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
index 7e31ddb93156bf301ef333bd5cbe71bb7acc9691..e3b33c15c437c1620c467844c6fef3193f200daf 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -1155,11 +1155,19 @@ void MetricsService::RecordCurrentHistograms() {
void MetricsService::RecordCurrentStabilityHistograms() {
DCHECK(log_manager_.current_log());
+ histogram_snapshot_manager_.StartDeltas();
// "true" indicates that StatisticsRecorder should include histograms in
// persistent storage.
- histogram_snapshot_manager_.PrepareDeltas(
- base::StatisticsRecorder::begin(true), base::StatisticsRecorder::end(),
- base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag);
+ auto end = base::StatisticsRecorder::end();
+ for (auto it = base::StatisticsRecorder::begin(true); it != end; ++it) {
+ if (((*it)->flags() & base::Histogram::kUmaStabilityHistogramFlag) ==
+ base::Histogram::kUmaStabilityHistogramFlag) {
+ histogram_snapshot_manager_.PrepareDelta(*it);
+ }
+ }
+ for (MetricsProvider* provider : metrics_providers_)
+ provider->RecordStabilityHistogramSnapshots(&histogram_snapshot_manager_);
Ilya Sherman 2016/05/04 06:48:08 This doesn't seem like the right place to add this
bcwhite 2016/05/04 14:12:51 Correct. This method is called only from PrepareI
+ histogram_snapshot_manager_.FinishDeltas();
}
void MetricsService::LogCleanShutdown() {

Powered by Google App Engine
This is Rietveld 408576698