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

Unified Diff: base/metrics/sparse_histogram.h

Issue 13469020: Implement write methods for SparseHistogram (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « no previous file | base/metrics/sparse_histogram.cc » ('j') | base/metrics/sparse_histogram.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/sparse_histogram.h
diff --git a/base/metrics/sparse_histogram.h b/base/metrics/sparse_histogram.h
index 9c207666e5d04c21fa97978438617827b7a4085f..ca1c537947a3afb9056fb24adaff5e4b1867628e 100644
--- a/base/metrics/sparse_histogram.h
+++ b/base/metrics/sparse_histogram.h
@@ -90,6 +90,27 @@ class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase {
virtual void GetCountAndBucketData(Count* count,
ListValue* buckets) const OVERRIDE;
+ // Helpers for emitting Ascii graphic. Each method appends data to output.
+ void WriteAsciiImpl(bool graph_it,
+ const std::string& newline,
+ std::string* output) const;
+
+ // Write a common header message describing this histogram.
+ void WriteAsciiHeader(const Count sample_count,
+ std::string* output) const;
+
+ // Write textual description of the bucket contents (relative to histogram).
+ // Output is the count in the buckets, as well as the percentage.
+ void WriteAsciiBucketValue(const Count current, const Count total,
jar (doing other things) 2013/04/04 00:45:09 nit: one arg per line in declaration and definitio
jrummell 2013/04/04 22:38:59 Done.
+ std::string* output) const;
+
+ // Produce actual graph (set of blank vs non blank char's) for a bucket.
+ void WriteAsciiBucketGraph(double current_size, double max_size,
+ std::string* output) const;
+
+ // Return a string description of what goes in a given bucket.
+ std::string GetAsciiBucketRange(const Sample sample) const;
+
// For constuctor calling.
friend class SparseHistogramTest;
« no previous file with comments | « no previous file | base/metrics/sparse_histogram.cc » ('j') | base/metrics/sparse_histogram.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698