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

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: only 50 bucktes for file age 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..52696dc63a08485623b67fa69c4e1594895e6751 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(), 50);
+ }
}
// 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