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

Unified Diff: base/metrics/histogram.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
Index: base/metrics/histogram.h
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 72da2e0415ffed6dfd190dd64cfdd64b5ac9cc02..a93cb1cc6d43404e0e06623e4e91bb152cf14a48 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -396,7 +396,6 @@ class BASE_EXPORT Histogram : public HistogramBase {
static void InitializeBucketRanges(Sample minimum,
Sample maximum,
- size_t bucket_count,
BucketRanges* ranges);
// This constant if for FindCorruption. Since snapshots of histograms are
@@ -421,7 +420,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
Sample declared_min() const { return declared_min_; }
Sample declared_max() const { return declared_max_; }
virtual Sample ranges(size_t i) const;
- virtual size_t bucket_count() const;
+ virtual size_t BucketCount() const;
const BucketRanges* bucket_ranges() const { return bucket_ranges_; }
// This function validates histogram construction arguments. It returns false
@@ -448,12 +447,11 @@ class BASE_EXPORT Histogram : public HistogramBase {
virtual void WriteAscii(std::string* output) const OVERRIDE;
protected:
- // |bucket_count| and |ranges| should contain the underflow and overflow
- // buckets. See top comments for example.
+ // |ranges| should contain the underflow and overflow buckets. See top
+ // comments for example.
Histogram(const std::string& name,
Sample minimum,
Sample maximum,
- size_t bucket_count,
const BucketRanges* ranges);
virtual ~Histogram();
@@ -521,9 +519,8 @@ class BASE_EXPORT Histogram : public HistogramBase {
// Does not own this object. Should get from StatisticsRecorder.
const BucketRanges* bucket_ranges_;
- Sample declared_min_; // Less than this goes into counts_[0]
- Sample declared_max_; // Over this goes into counts_[bucket_count_ - 1].
- size_t bucket_count_; // Dimension of counts_[].
+ Sample declared_min_; // Less than this goes into the first bucket.
+ Sample declared_max_; // Over this goes into the last bucket.
// Finally, provide the state that changes with the addition of each new
// sample.
@@ -573,7 +570,6 @@ class BASE_EXPORT LinearHistogram : public Histogram {
static void InitializeBucketRanges(Sample minimum,
Sample maximum,
- size_t bucket_count,
BucketRanges* ranges);
// Overridden from Histogram:
@@ -583,7 +579,6 @@ class BASE_EXPORT LinearHistogram : public Histogram {
LinearHistogram(const std::string& name,
Sample minimum,
Sample maximum,
- size_t bucket_count,
const BucketRanges* ranges);
virtual double GetBucketSize(Count current, size_t i) const OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698