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

Unified Diff: base/test/histogram_tester.cc

Issue 1471073007: Reorganize histograms for persistence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: addressed review comments by Alexei Created 5 years 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
Index: base/test/histogram_tester.cc
diff --git a/base/test/histogram_tester.cc b/base/test/histogram_tester.cc
index 7fcde6d60eebd4acd57d822aec9fbeca37798215..2cbad9368b0a52eb04ca30c9a3ffee27271f6224 100644
--- a/base/test/histogram_tester.cc
+++ b/base/test/histogram_tester.cc
@@ -6,6 +6,7 @@
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_samples.h"
+#include "base/metrics/metrics_hashes.h"
#include "base/metrics/sample_map.h"
#include "base/metrics/statistics_recorder.h"
#include "base/stl_util.h"
@@ -122,7 +123,8 @@ scoped_ptr<HistogramSamples> HistogramTester::GetHistogramSamplesSinceCreation(
// creates empty samples in the absence of the histogram, rather than
// returning null.
if (!histogram)
Alexei Svitkine (slow) 2015/12/09 23:03:40 Nit: {}
bcwhite 2015/12/10 14:51:33 Done.
- return scoped_ptr<HistogramSamples>(new SampleMap);
+ return scoped_ptr<HistogramSamples>(
+ new SampleMap(HashMetricName(histogram_name)));
scoped_ptr<HistogramSamples> named_samples(histogram->SnapshotSamples());
auto original_samples_it = histograms_snapshot_.find(histogram_name);
if (original_samples_it != histograms_snapshot_.end())

Powered by Google App Engine
This is Rietveld 408576698