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

Unified Diff: base/metrics/histogram.cc

Issue 13469020: Implement write methods for SparseHistogram (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase due to conflict in histogram_base.cc Created 7 years, 8 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 | « base/metrics/histogram.h ('k') | base/metrics/histogram_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 1f268295e24675df793195b692bfddb106d2902e..46f2c168fb6626f00904f7f821f056ba289e5f69 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -340,12 +340,7 @@ double Histogram::GetBucketSize(Count current, size_t i) const {
}
const string Histogram::GetAsciiBucketRange(size_t i) const {
- string result;
- if (kHexRangePrintingFlag & flags())
- StringAppendF(&result, "%#x", ranges(i));
- else
- StringAppendF(&result, "%d", ranges(i));
- return result;
+ return GetSimpleAsciiBucketRange(ranges(i));
}
//------------------------------------------------------------------------------
@@ -490,27 +485,6 @@ void Histogram::WriteAsciiBucketContext(const int64 past,
}
}
-void Histogram::WriteAsciiBucketValue(Count current,
- double scaled_sum,
- string* output) const {
- StringAppendF(output, " (%d = %3.1f%%)", current, current/scaled_sum);
-}
-
-void Histogram::WriteAsciiBucketGraph(double current_size,
- double max_size,
- string* output) const {
- const int k_line_length = 72; // Maximal horizontal width of graph.
- int x_count = static_cast<int>(k_line_length * (current_size / max_size)
- + 0.5);
- int x_remainder = k_line_length - x_count;
-
- while (0 < x_count--)
- output->append("-");
- output->append("O");
- while (0 < x_remainder--)
- output->append(" ");
-}
-
void Histogram::GetParameters(DictionaryValue* params) const {
params->SetString("type", HistogramTypeToString(GetHistogramType()));
params->SetInteger("min", declared_min());
« no previous file with comments | « base/metrics/histogram.h ('k') | base/metrics/histogram_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698