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

Side by Side Diff: base/metrics/histogram_base.h

Issue 1256363002: Add support to increase a UMA histogram bucket by an aribitrary integer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After rebase-update Created 5 years, 4 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
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/histogram_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 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_
6 #define BASE_METRICS_HISTOGRAM_BASE_H_ 6 #define BASE_METRICS_HISTOGRAM_BASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 // Whether the histogram has construction arguments as parameters specified. 115 // Whether the histogram has construction arguments as parameters specified.
116 // For histograms that don't have the concept of minimum, maximum or 116 // For histograms that don't have the concept of minimum, maximum or
117 // bucket_count, this function always returns false. 117 // bucket_count, this function always returns false.
118 virtual bool HasConstructionArguments(Sample expected_minimum, 118 virtual bool HasConstructionArguments(Sample expected_minimum,
119 Sample expected_maximum, 119 Sample expected_maximum,
120 size_t expected_bucket_count) const = 0; 120 size_t expected_bucket_count) const = 0;
121 121
122 virtual void Add(Sample value) = 0; 122 virtual void Add(Sample value) = 0;
123 123
124 // In Add function the |value| bucket is increased by one, but in some use
125 // cases we need to increase this value by an arbitrary integer. AddCount
126 // function increases the |value| bucket by |count|. |count| should be greater
127 // than or equal to 1.
128 virtual void AddCount(Sample value, int count) = 0;
129
124 // 2 convenient functions that call Add(Sample). 130 // 2 convenient functions that call Add(Sample).
125 void AddTime(const TimeDelta& time); 131 void AddTime(const TimeDelta& time);
126 void AddBoolean(bool value); 132 void AddBoolean(bool value);
127 133
128 virtual void AddSamples(const HistogramSamples& samples) = 0; 134 virtual void AddSamples(const HistogramSamples& samples) = 0;
129 virtual bool AddSamplesFromPickle(base::PickleIterator* iter) = 0; 135 virtual bool AddSamplesFromPickle(base::PickleIterator* iter) = 0;
130 136
131 // Serialize the histogram info into |pickle|. 137 // Serialize the histogram info into |pickle|.
132 // Note: This only serializes the construction arguments of the histogram, but 138 // Note: This only serializes the construction arguments of the histogram, but
133 // does not serialize the samples. 139 // does not serialize the samples.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 private: 191 private:
186 const std::string histogram_name_; 192 const std::string histogram_name_;
187 int32_t flags_; 193 int32_t flags_;
188 194
189 DISALLOW_COPY_AND_ASSIGN(HistogramBase); 195 DISALLOW_COPY_AND_ASSIGN(HistogramBase);
190 }; 196 };
191 197
192 } // namespace base 198 } // namespace base
193 199
194 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ 200 #endif // BASE_METRICS_HISTOGRAM_BASE_H_
OLDNEW
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698