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

Unified Diff: base/metrics/histogram.cc

Issue 2382503002: Cleanup histograms from message loop, as well as kHexRangePrintingFlag. (Closed)
Patch Set: make flag comment nicer Created 4 years, 3 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/message_loop/message_loop.cc ('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 ab6cdd0f2d6ba3d09f7cc646878aff389a2ed4da..a75abd649b23b1d52e9c290eb1fa632c58f633d9 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -673,15 +673,14 @@ void Histogram::WriteAsciiHeader(const SampleVector& samples,
"Histogram: %s recorded %d samples",
histogram_name().c_str(),
sample_count);
- if (0 == sample_count) {
+ if (sample_count == 0) {
DCHECK_EQ(samples.sum(), 0);
} else {
- double average = static_cast<float>(samples.sum()) / sample_count;
-
- StringAppendF(output, ", average = %.1f", average);
+ double mean = static_cast<float>(samples.sum()) / sample_count;
+ StringAppendF(output, ", mean = %.1f", mean);
}
- if (flags() & ~kHexRangePrintingFlag)
- StringAppendF(output, " (flags = 0x%x)", flags() & ~kHexRangePrintingFlag);
+ if (flags())
+ StringAppendF(output, " (flags = 0x%x)", flags());
}
void Histogram::WriteAsciiBucketContext(const int64_t past,
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | base/metrics/histogram_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698