summaryrefslogtreecommitdiffstats
path: root/base/metrics
diff options
context:
space:
mode:
authorlpromero@chromium.org <lpromero@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 16:12:09 +0000
committerlpromero@chromium.org <lpromero@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 16:12:09 +0000
commit16c7abc10a5585ee9fa0efdeb0723710fed93728 (patch)
treef4486075af79ef0cfd1d3857749f5a999440ff8c /base/metrics
parent69074ca888e1fa9cdad846333d2267751e44d8ea (diff)
downloadchromium_src-16c7abc10a5585ee9fa0efdeb0723710fed93728.zip
chromium_src-16c7abc10a5585ee9fa0efdeb0723710fed93728.tar.gz
chromium_src-16c7abc10a5585ee9fa0efdeb0723710fed93728.tar.bz2
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
Diffstat (limited to 'base/metrics')
-rw-r--r--base/metrics/statistics_recorder.h7
1 files changed, 4 insertions, 3 deletions
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);