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 // SampleVector implements HistogramSamples interface. It is used by all | 5 // SampleVector implements HistogramSamples interface. It is used by all |
6 // Histogram based classes to store samples. | 6 // Histogram based classes to store samples. |
7 | 7 |
8 #ifndef BASE_METRICS_SAMPLE_VECTOR_H_ | 8 #ifndef BASE_METRICS_SAMPLE_VECTOR_H_ |
9 #define BASE_METRICS_SAMPLE_VECTOR_H_ | 9 #define BASE_METRICS_SAMPLE_VECTOR_H_ |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 const BucketRanges* bucket_ranges); | 155 const BucketRanges* bucket_ranges); |
156 SampleVectorIterator(const HistogramBase::AtomicCount* counts, | 156 SampleVectorIterator(const HistogramBase::AtomicCount* counts, |
157 size_t counts_size, | 157 size_t counts_size, |
158 const BucketRanges* bucket_ranges); | 158 const BucketRanges* bucket_ranges); |
159 ~SampleVectorIterator() override; | 159 ~SampleVectorIterator() override; |
160 | 160 |
161 // SampleCountIterator implementation: | 161 // SampleCountIterator implementation: |
162 bool Done() const override; | 162 bool Done() const override; |
163 void Next() override; | 163 void Next() override; |
164 void Get(HistogramBase::Sample* min, | 164 void Get(HistogramBase::Sample* min, |
165 HistogramBase::Sample* max, | 165 int64_t* max, |
166 HistogramBase::Count* count) const override; | 166 HistogramBase::Count* count) const override; |
167 | 167 |
168 // SampleVector uses predefined buckets, so iterator can return bucket index. | 168 // SampleVector uses predefined buckets, so iterator can return bucket index. |
169 bool GetBucketIndex(size_t* index) const override; | 169 bool GetBucketIndex(size_t* index) const override; |
170 | 170 |
171 private: | 171 private: |
172 void SkipEmptyBuckets(); | 172 void SkipEmptyBuckets(); |
173 | 173 |
174 const HistogramBase::AtomicCount* counts_; | 174 const HistogramBase::AtomicCount* counts_; |
175 size_t counts_size_; | 175 size_t counts_size_; |
176 const BucketRanges* bucket_ranges_; | 176 const BucketRanges* bucket_ranges_; |
177 | 177 |
178 size_t index_; | 178 size_t index_; |
179 }; | 179 }; |
180 | 180 |
181 } // namespace base | 181 } // namespace base |
182 | 182 |
183 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ | 183 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ |
OLD | NEW |