Chromium Code Reviews| Index: components/metrics/metrics_service.cc |
| diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc |
| index 50545b3f68d2758e7307dac7edd23cb7d08a35e1..0c9bda693dc1810af9dacad9943f55751406e878 100644 |
| --- a/components/metrics/metrics_service.cc |
| +++ b/components/metrics/metrics_service.cc |
| @@ -133,6 +133,7 @@ |
| #include "base/location.h" |
| #include "base/metrics/histogram_base.h" |
| #include "base/metrics/histogram_macros.h" |
| +#include "base/metrics/histogram_persistence.h" |
| #include "base/metrics/histogram_samples.h" |
| #include "base/metrics/sparse_histogram.h" |
| #include "base/metrics/statistics_recorder.h" |
| @@ -740,6 +741,13 @@ void MetricsService::CloseCurrentLog() { |
| OpenNewLog(); // Start trivial log to hold our histograms. |
| } |
| + // If a persistent allocator is in use, update its internal histograms (such |
| + // as how much memory is being used) before reporting. |
| + base::PersistentMemoryAllocator* allocator = |
| + base::GetPersistentHistogramMemoryAllocator(); |
| + if (allocator) |
| + allocator->UpdateStaticHistograms(); |
| + |
| // Put incremental data (histogram deltas, and realtime stats deltas) at the |
| // end of all log transmissions (initial log handles this separately). |
| // RecordIncrementalStabilityElements only exists on the derived |
| @@ -1100,12 +1108,14 @@ void MetricsService::RecordCurrentEnvironment(MetricsLog* log) { |
| void MetricsService::RecordCurrentHistograms() { |
| DCHECK(log_manager_.current_log()); |
| histogram_snapshot_manager_.PrepareDeltas( |
| + base::StatisticsRecorder::begin(true), base::StatisticsRecorder::end(), |
| base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag); |
| } |
| void MetricsService::RecordCurrentStabilityHistograms() { |
| DCHECK(log_manager_.current_log()); |
| histogram_snapshot_manager_.PrepareDeltas( |
| + base::StatisticsRecorder::begin(true), base::StatisticsRecorder::end(), |
|
Alexei Svitkine (slow)
2016/01/18 19:25:36
For all the calls to begin(), can you add a commen
bcwhite
2016/01/22 15:24:53
Done.
|
| base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag); |
| } |