Index: base/test/histogram_tester.h |
diff --git a/base/test/histogram_tester.h b/base/test/histogram_tester.h |
index 96317f98d2d33283ed09a8d3e69487312af1dd38..8178abb5806d77c6811d23d790aca2aa8216fd0a 100644 |
--- a/base/test/histogram_tester.h |
+++ b/base/test/histogram_tester.h |
@@ -47,6 +47,25 @@ class HistogramTester { |
void ExpectTotalCount(const std::string& name, |
base::HistogramBase::Count count) const; |
+ // Finds histograms whose names start with |query|, and return a text |
Ilya Sherman
2015/06/23 00:57:40
nit: "return" -> "returns"
|
+ // representation of any new samples added since the creation of this object. |
+ // Histograms that are unchanged are omitted from the result. The return value |
+ // consists of lines of the form: |
+ // |
+ // - "My.Statistic.Name[2]=5" (for linear, boolean, and enum histograms) |
+ // - "My.Statistic.Name=5" (for other kinds of histograms) |
+ // |
+ // In the above example, 2 is the bucket min and 5 is the count. For nonlinear |
+ // histograms, only the total across all buckets is shown, under the |
+ // assumption that the inputs to nonlinear histograms -- sizes and times, |
+ // commonly -- may be hard for a test to predict. |
+ // |
+ // This is useful for cases where the code under test is choosing among a |
+ // family of related histograms and incrementing one of them. Typically you |
+ // should pass the result of this function directly to EXPECT_EQ, which does a |
+ // good job of formatting human-readable diffs of multi-line strings. |
Ilya Sherman
2015/06/23 00:57:40
nit: You should probably mention somewhere that th
|
+ std::string GetTotalCountsForQuery(const std::string& query) const; |
+ |
// Access a modified HistogramSamples containing only what has been logged |
// to the histogram since the creation of this object. |
scoped_ptr<HistogramSamples> GetHistogramSamplesSinceCreation( |