OLD | NEW |
---|---|
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 virtual HistogramType GetHistogramType() const = 0; | 113 virtual HistogramType GetHistogramType() const = 0; |
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 virtual void MultiAdd(Sample value, int repetition) = 0; | |
Alexei Svitkine (slow)
2015/07/31 15:39:27
How about naming it AddCount(value, count). Also a
amohammadkhan
2015/08/03 17:30:43
Done.
| |
123 | 124 |
124 // 2 convenient functions that call Add(Sample). | 125 // 2 convenient functions that call Add(Sample). |
125 void AddTime(const TimeDelta& time); | 126 void AddTime(const TimeDelta& time); |
126 void AddBoolean(bool value); | 127 void AddBoolean(bool value); |
127 | 128 |
128 virtual void AddSamples(const HistogramSamples& samples) = 0; | 129 virtual void AddSamples(const HistogramSamples& samples) = 0; |
129 virtual bool AddSamplesFromPickle(base::PickleIterator* iter) = 0; | 130 virtual bool AddSamplesFromPickle(base::PickleIterator* iter) = 0; |
130 | 131 |
131 // Serialize the histogram info into |pickle|. | 132 // Serialize the histogram info into |pickle|. |
132 // Note: This only serializes the construction arguments of the histogram, but | 133 // Note: This only serializes the construction arguments of the histogram, but |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 private: | 186 private: |
186 const std::string histogram_name_; | 187 const std::string histogram_name_; |
187 int32_t flags_; | 188 int32_t flags_; |
188 | 189 |
189 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 190 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
190 }; | 191 }; |
191 | 192 |
192 } // namespace base | 193 } // namespace base |
193 | 194 |
194 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 195 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
OLD | NEW |