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

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: 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') | base/metrics/statistics_recorder_unittest.cc » ('J')
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..4b07b57eb08c841e22ce700a3c504c0545a20bcc 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 BucketCount() const { return ranges_.size() - 1; }
Alexei Svitkine (slow) 2013/06/20 05:53:32 Drive by nit: This should probably either use hac
Ilya Sherman 2013/06/20 05:57:34 I don't have a strong preference. Jim, which of t
jar (doing other things) 2013/06/20 16:41:18 I was a little tentative about the cost... but I g
Ilya Sherman 2013/06/21 04:03:05 Done.
+
// 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') | base/metrics/statistics_recorder_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698