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

Unified Diff: components/metrics/file_metrics_provider.cc

Issue 2966773002: Add histograms to learn about metrics files dropped for lack of an embedded profile. (Closed)
Patch Set: addressed review comments by asvitkine Created 3 years, 6 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('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 61297c6e32b198084f64e80e1f2d339cbb8c3b6f..fa85165863c7ac1997d6c161e9d0f90b23c8c0ad 100644
--- a/components/metrics/file_metrics_provider.cc
+++ b/components/metrics/file_metrics_provider.cc
@@ -546,6 +546,26 @@ bool FileMetricsProvider::ProvideIndependentMetrics(
RecordEmbeddedProfileResult(EMBEDDED_PROFILE_FOUND);
} else {
RecordEmbeddedProfileResult(EMBEDDED_PROFILE_DROPPED);
+
+ // TODO(bcwhite): Remove these once crbug/695880 is resolved.
+
+ int histogram_count = 0;
+ base::PersistentHistogramAllocator::Iterator histogram_iter(
+ source->allocator.get());
+ while (histogram_iter.GetNext()) {
+ ++histogram_count;
+ }
+ UMA_HISTOGRAM_COUNTS_10000(
+ "UMA.FileMetricsProvider.EmbeddedProfile.DroppedHistogramCount",
+ histogram_count);
+
+ base::File::Info info;
+ if (base::GetFileInfo(source->path, &info)) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "UMA.FileMetricsProvider.EmbeddedProfile.DroppedFileAge",
+ (base::Time::Now() - info.last_modified).InMinutes(), 1,
+ base::TimeDelta::FromDays(30).InMinutes(), 100);
Alexei Svitkine (slow) 2017/06/30 16:28:40 Nit: Suggest 50 buckets. I don't think we need 100
bcwhite 2017/06/30 16:33:53 Done.
+ }
}
// Regardless of whether this source was successfully recorded, it is never
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698