| 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 18 matching lines...) Expand all Loading... |
| 29 size_t counts_size, | 29 size_t counts_size, |
| 30 Metadata* meta, | 30 Metadata* meta, |
| 31 const BucketRanges* bucket_ranges); | 31 const BucketRanges* bucket_ranges); |
| 32 ~SampleVector() override; | 32 ~SampleVector() override; |
| 33 | 33 |
| 34 // HistogramSamples implementation: | 34 // HistogramSamples implementation: |
| 35 void Accumulate(HistogramBase::Sample value, | 35 void Accumulate(HistogramBase::Sample value, |
| 36 HistogramBase::Count count) override; | 36 HistogramBase::Count count) override; |
| 37 HistogramBase::Count GetCount(HistogramBase::Sample value) const override; | 37 HistogramBase::Count GetCount(HistogramBase::Sample value) const override; |
| 38 HistogramBase::Count TotalCount() const override; | 38 HistogramBase::Count TotalCount() const override; |
| 39 void Negate() override; |
| 39 scoped_ptr<SampleCountIterator> Iterator() const override; | 40 scoped_ptr<SampleCountIterator> Iterator() const override; |
| 40 | 41 |
| 41 // Get count of a specific bucket. | 42 // Get count of a specific bucket. |
| 42 HistogramBase::Count GetCountAtIndex(size_t bucket_index) const; | 43 HistogramBase::Count GetCountAtIndex(size_t bucket_index) const; |
| 43 | 44 |
| 44 protected: | 45 protected: |
| 45 bool AddSubtractImpl( | 46 bool AddSubtractImpl( |
| 46 SampleCountIterator* iter, | 47 SampleCountIterator* iter, |
| 47 HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT. | 48 HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT. |
| 48 | 49 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const HistogramBase::AtomicCount* counts_; | 93 const HistogramBase::AtomicCount* counts_; |
| 93 size_t counts_size_; | 94 size_t counts_size_; |
| 94 const BucketRanges* bucket_ranges_; | 95 const BucketRanges* bucket_ranges_; |
| 95 | 96 |
| 96 size_t index_; | 97 size_t index_; |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 } // namespace base | 100 } // namespace base |
| 100 | 101 |
| 101 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ | 102 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ |
| OLD | NEW |