From 16c7abc10a5585ee9fa0efdeb0723710fed93728 Mon Sep 17 00:00:00 2001 From: "lpromero@chromium.org" Date: Tue, 7 Jan 2014 16:12:09 +0000 Subject: Add a StatisticsDeltaReader class and use cases This CL adds a utility class to streamline the task of testing that metrics have been updated as expected. Specifically, the StatisticsDeltaReader class allows a client to obtain the differential value of a given histogram in the interval since the given StatisticsDeltaReader instance was created. This reverts commit 6a7dfb3cd638829a04e002ea9bc5b18ed3c9c03f. BUG=232414 TBR=rsleevy, groby Review URL: https://codereview.chromium.org/120753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243303 0039d316-1c4b-4281-b951-d872f2087c98 --- base/metrics/statistics_recorder.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'base/metrics') diff --git a/base/metrics/statistics_recorder.h b/base/metrics/statistics_recorder.h index 0716e80..5e53f274 100644 --- a/base/metrics/statistics_recorder.h +++ b/base/metrics/statistics_recorder.h @@ -70,9 +70,9 @@ class BASE_EXPORT StatisticsRecorder { static HistogramBase* FindHistogram(const std::string& name); // GetSnapshot copies some of the pointers to registered histograms into the - // caller supplied vector (Histograms). Only histograms with names matching - // query are returned. The query must be a substring of histogram name for its - // pointer to be copied. + // caller supplied vector (Histograms). Only histograms which have |query| as + // a substring are copied (an empty string will process all registered + // histograms). static void GetSnapshot(const std::string& query, Histograms* snapshot); private: @@ -88,6 +88,7 @@ class BASE_EXPORT StatisticsRecorder { friend class HistogramBaseTest; friend class HistogramTest; friend class SparseHistogramTest; + friend class StatisticsDeltaReaderTest; friend class StatisticsRecorderTest; FRIEND_TEST_ALL_PREFIXES(HistogramDeltaSerializationTest, DeserializeHistogramAndAddSamples); -- cgit v1.1