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

Unified Diff: components/metrics/file_metrics_provider.cc

Issue 2658163002: Merge histograms from providers into StatisticsRecorder for display. (Closed)
Patch Set: rebased Created 3 years, 11 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
« no previous file with comments | « components/metrics/file_metrics_provider.h ('k') | components/metrics/metrics_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/file_metrics_provider.cc
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc
index 1972019ef9badd1e93ec392b20e06e630b8739e7..24cfa9b761368155ec1698486ceef795f8a89a82 100644
--- a/components/metrics/file_metrics_provider.cc
+++ b/components/metrics/file_metrics_provider.cc
@@ -122,6 +122,8 @@ FileMetricsProvider::FileMetricsProvider(
: task_runner_(task_runner),
pref_service_(local_state),
weak_factory_(this) {
+ base::StatisticsRecorder::RegisterHistogramProvider(
+ weak_factory_.GetWeakPtr());
}
FileMetricsProvider::~FileMetricsProvider() {}
@@ -522,20 +524,6 @@ bool FileMetricsProvider::HasInitialStabilityMetrics() {
return !sources_for_previous_run_.empty();
}
-void FileMetricsProvider::MergeHistogramDeltas() {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- // Measure the total time spent processing all sources as well as the time
- // per individual file. This method is called on the UI thread so it's
- // important to know how much total "jank" may be introduced.
- SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.Total");
-
- for (std::unique_ptr<SourceInfo>& source : sources_mapped_) {
- SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.File");
- MergeHistogramDeltasFromSource(source.get());
- }
-}
-
void FileMetricsProvider::RecordInitialHistogramSnapshots(
base::HistogramSnapshotManager* snapshot_manager) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -564,4 +552,18 @@ void FileMetricsProvider::RecordInitialHistogramSnapshots(
}
}
+void FileMetricsProvider::MergeHistogramDeltas() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ // Measure the total time spent processing all sources as well as the time
+ // per individual file. This method is called on the UI thread so it's
+ // important to know how much total "jank" may be introduced.
+ SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.Total");
+
+ for (std::unique_ptr<SourceInfo>& source : sources_mapped_) {
+ SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.File");
+ MergeHistogramDeltasFromSource(source.get());
+ }
+}
+
} // namespace metrics
« no previous file with comments | « components/metrics/file_metrics_provider.h ('k') | components/metrics/metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698