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

Unified Diff: base/metrics/bucket_ranges.h

Issue 17451016: [UMA] Remove redundant bucket_count variable from base::Histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename variables to be clearer Created 7 years, 6 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/bucket_ranges_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/bucket_ranges.h
diff --git a/base/metrics/bucket_ranges.h b/base/metrics/bucket_ranges.h
index 210b9a7e510a9efea40196248e78c7a5e0502d28..fe1152f5dbc714642bb258040d62ecc4fcaef8c5 100644
--- a/base/metrics/bucket_ranges.h
+++ b/base/metrics/bucket_ranges.h
@@ -39,6 +39,12 @@ class BASE_EXPORT BucketRanges {
uint32 checksum() const { return checksum_; }
void set_checksum(uint32 checksum) { checksum_ = checksum; }
+ // A bucket is defined by a consecutive pair of entries in |ranges|, so there
+ // is one fewer bucket than there are ranges. For example, if |ranges| is
+ // [0, 1, 3, 7, INT_MAX], then the buckets in this histogram are
+ // [0, 1), [1, 3), [3, 7), and [7, INT_MAX).
+ size_t bucket_count() const { return ranges_.size() - 1; }
+
// Checksum methods to verify whether the ranges are corrupted (e.g. bad
// memory access).
uint32 CalculateChecksum() const;
« no previous file with comments | « no previous file | base/metrics/bucket_ranges_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698