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

Side by Side Diff: base/metrics/sparse_histogram.cc

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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/metrics/sparse_histogram.h ('k') | base/metrics/statistics_recorder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/metrics/sparse_histogram.h" 5 #include "base/metrics/sparse_histogram.h"
6 6
7 #include "base/metrics/sample_map.h" 7 #include "base/metrics/sample_map.h"
8 #include "base/metrics/statistics_recorder.h" 8 #include "base/metrics/statistics_recorder.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 21 matching lines...) Expand all
32 DCHECK_EQ(SPARSE_HISTOGRAM, histogram->GetHistogramType()); 32 DCHECK_EQ(SPARSE_HISTOGRAM, histogram->GetHistogramType());
33 return histogram; 33 return histogram;
34 } 34 }
35 35
36 SparseHistogram::~SparseHistogram() {} 36 SparseHistogram::~SparseHistogram() {}
37 37
38 HistogramType SparseHistogram::GetHistogramType() const { 38 HistogramType SparseHistogram::GetHistogramType() const {
39 return SPARSE_HISTOGRAM; 39 return SPARSE_HISTOGRAM;
40 } 40 }
41 41
42 bool SparseHistogram::HasConstructionArguments(Sample minimum, 42 bool SparseHistogram::HasConstructionArguments(
43 Sample maximum, 43 Sample expected_minimum,
44 size_t bucket_count) const { 44 Sample expected_maximum,
45 size_t expected_bucket_count) const {
45 // SparseHistogram never has min/max/bucket_count limit. 46 // SparseHistogram never has min/max/bucket_count limit.
46 return false; 47 return false;
47 } 48 }
48 49
49 void SparseHistogram::Add(Sample value) { 50 void SparseHistogram::Add(Sample value) {
50 base::AutoLock auto_lock(lock_); 51 base::AutoLock auto_lock(lock_);
51 samples_.Accumulate(value, 1); 52 samples_.Accumulate(value, 1);
52 } 53 }
53 54
54 scoped_ptr<HistogramSamples> SparseHistogram::SnapshotSamples() const { 55 scoped_ptr<HistogramSamples> SparseHistogram::SnapshotSamples() const {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 std::string* output) const { 170 std::string* output) const {
170 StringAppendF(output, 171 StringAppendF(output,
171 "Histogram: %s recorded %d samples", 172 "Histogram: %s recorded %d samples",
172 histogram_name().c_str(), 173 histogram_name().c_str(),
173 total_count); 174 total_count);
174 if (flags() & ~kHexRangePrintingFlag) 175 if (flags() & ~kHexRangePrintingFlag)
175 StringAppendF(output, " (flags = 0x%x)", flags() & ~kHexRangePrintingFlag); 176 StringAppendF(output, " (flags = 0x%x)", flags() & ~kHexRangePrintingFlag);
176 } 177 }
177 178
178 } // namespace base 179 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/sparse_histogram.h ('k') | base/metrics/statistics_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698