Chromium Code Reviews| 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..cfc38ff73ee8161264059d7ef00e945cc4eb63ba 100644 |
| --- a/components/metrics/file_metrics_provider.cc |
| +++ b/components/metrics/file_metrics_provider.cc |
| @@ -546,6 +546,30 @@ 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 (true) { |
| + std::unique_ptr<base::HistogramBase> histogram = |
| + histogram_iter.GetNext(); |
| + if (!histogram) |
| + break; |
| + ++histogram_count; |
| + } |
|
Alexei Svitkine (slow)
2017/06/30 14:50:10
Nit: How about:
while (histogram_iter.GetNext())
bcwhite
2017/06/30 15:12:15
Done.
|
| + UMA_HISTOGRAM_COUNTS_1000( |
|
Alexei Svitkine (slow)
2017/06/30 14:50:10
Nit: Suggest using 10k version of the macro becaus
bcwhite
2017/06/30 15:12:16
Done. It doesn't really matter either way. If it
|
| + "UMA.FileMetricsProvider.EmbeddedProfile.DroppedHistogramCount", |
| + histogram_count); |
| + |
| + base::File::Info info; |
| + if (base::GetFileInfo(source->path, &info)) { |
| + UMA_HISTOGRAM_CUSTOM_TIMES( |
| + "UMA.FileMetricsProvider.EmbeddedProfile.DroppedFileAge", |
| + base::Time::Now() - info.last_modified, |
| + base::TimeDelta::FromSeconds(1), base::TimeDelta::FromDays(1), 100); |
|
Alexei Svitkine (slow)
2017/06/30 14:50:10
I think logging in ms is not useful here, so you d
bcwhite
2017/06/30 15:12:16
Done.
|
| + } |
| } |
| // Regardless of whether this source was successfully recorded, it is never |