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

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

Issue 11342060: Histogram type support in HistogramBase and remove SetRangeDescription function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove "using" from metrics.cc Created 8 years, 1 month 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') | chrome/browser/extensions/api/metrics/metrics.h » ('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/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 10
11 using std::map; 11 using std::map;
12 using std::string; 12 using std::string;
13 13
14 namespace base { 14 namespace base {
15 15
16 typedef HistogramBase::Count Count; 16 typedef HistogramBase::Count Count;
17 typedef HistogramBase::Sample Sample; 17 typedef HistogramBase::Sample Sample;
18 18
19 // static 19 // static
20 HistogramBase* SparseHistogram::FactoryGet(const string& name, int32 flags) { 20 HistogramBase* SparseHistogram::FactoryGet(const string& name, int32 flags) {
21 // TODO(kaiwang): Register and get SparseHistogram with StatisticsRecorder. 21 // TODO(kaiwang): Register and get SparseHistogram with StatisticsRecorder.
22 HistogramBase* histogram = new SparseHistogram(name); 22 HistogramBase* histogram = new SparseHistogram(name);
23 histogram->SetFlags(flags); 23 histogram->SetFlags(flags);
24 return histogram; 24 return histogram;
25 } 25 }
26 26
27 SparseHistogram::~SparseHistogram() {} 27 SparseHistogram::~SparseHistogram() {}
28 28
29 HistogramType SparseHistogram::GetHistogramType() const {
30 return SPARSE_HISTOGRAM;
31 }
32
29 bool SparseHistogram::HasConstructionArguments(Sample minimum, 33 bool SparseHistogram::HasConstructionArguments(Sample minimum,
30 Sample maximum, 34 Sample maximum,
31 size_t bucket_count) const { 35 size_t bucket_count) const {
32 // SparseHistogram never has min/max/bucket_count limit. 36 // SparseHistogram never has min/max/bucket_count limit.
33 return false; 37 return false;
34 } 38 }
35 39
36 void SparseHistogram::Add(Sample value) { 40 void SparseHistogram::Add(Sample value) {
37 base::AutoLock auto_lock(lock_); 41 base::AutoLock auto_lock(lock_);
38 sample_counts_[value]++; 42 sample_counts_[value]++;
(...skipping 28 matching lines...) Expand all
67 void SparseHistogram::GetParameters(DictionaryValue* params) const { 71 void SparseHistogram::GetParameters(DictionaryValue* params) const {
68 // TODO(kaiwang): Implement. (See HistogramBase::WriteJSON.) 72 // TODO(kaiwang): Implement. (See HistogramBase::WriteJSON.)
69 } 73 }
70 74
71 void SparseHistogram::GetCountAndBucketData(Count* count, 75 void SparseHistogram::GetCountAndBucketData(Count* count,
72 ListValue* buckets) const { 76 ListValue* buckets) const {
73 // TODO(kaiwang): Implement. (See HistogramBase::WriteJSON.) 77 // TODO(kaiwang): Implement. (See HistogramBase::WriteJSON.)
74 } 78 }
75 79
76 } // namespace base 80 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/sparse_histogram.h ('k') | chrome/browser/extensions/api/metrics/metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698