| 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 // BucketRanges stores the vector of ranges that delimit what samples are | 5 // BucketRanges stores the vector of ranges that delimit what samples are |
| 6 // tallied in the corresponding buckets of a histogram. Histograms that have | 6 // tallied in the corresponding buckets of a histogram. Histograms that have |
| 7 // same ranges for all their corresponding buckets should share the same | 7 // same ranges for all their corresponding buckets should share the same |
| 8 // BucketRanges object. | 8 // BucketRanges object. |
| 9 // | 9 // |
| 10 // E.g. A 5 buckets LinearHistogram with 1 as minimal value and 4 as maximal | 10 // E.g. A 5 buckets LinearHistogram with 1 as minimal value and 4 as maximal |
| 11 // value will need a BucketRanges with 6 ranges: | 11 // value will need a BucketRanges with 6 ranges: |
| 12 // 0, 1, 2, 3, 4, INT_MAX | 12 // 0, 1, 2, 3, 4, INT_MAX |
| 13 // | 13 // |
| 14 // TODO(kaiwang): Currently we keep all negative values in 0~1 bucket. Consider | 14 // TODO(kaiwang): Currently we keep all negative values in 0~1 bucket. Consider |
| 15 // changing 0 to INT_MIN. | 15 // changing 0 to INT_MIN. |
| 16 | 16 |
| 17 #ifndef BASE_METRICS_BUCKET_RANGES_H_ | 17 #ifndef BASE_METRICS_BUCKET_RANGES_H_ |
| 18 #define BASE_METRICS_BUCKET_RANGES_H_ | 18 #define BASE_METRICS_BUCKET_RANGES_H_ |
| 19 | 19 |
| 20 #include <vector> | 20 #include <vector> |
| 21 | 21 |
| 22 #include "base/base_export.h" | 22 #include "base/base_export.h" |
| 23 #include "base/basictypes.h" | 23 #include "base/basictypes.h" |
| 24 #include "base/gtest_prod_util.h" | |
| 25 #include "base/metrics/histogram_base.h" | 24 #include "base/metrics/histogram_base.h" |
| 26 | 25 |
| 27 namespace base { | 26 namespace base { |
| 28 | 27 |
| 29 class BASE_EXPORT BucketRanges { | 28 class BASE_EXPORT BucketRanges { |
| 30 public: | 29 public: |
| 31 typedef std::vector<HistogramBase::Sample> Ranges; | 30 typedef std::vector<HistogramBase::Sample> Ranges; |
| 32 | 31 |
| 33 explicit BucketRanges(size_t num_ranges); | 32 explicit BucketRanges(size_t num_ranges); |
| 34 ~BucketRanges(); | 33 ~BucketRanges(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 DISALLOW_COPY_AND_ASSIGN(BucketRanges); | 69 DISALLOW_COPY_AND_ASSIGN(BucketRanges); |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 ////////////////////////////////////////////////////////////////////////////// | 72 ////////////////////////////////////////////////////////////////////////////// |
| 74 // Expose only for test. | 73 // Expose only for test. |
| 75 BASE_EXPORT_PRIVATE extern const uint32 kCrcTable[256]; | 74 BASE_EXPORT_PRIVATE extern const uint32 kCrcTable[256]; |
| 76 | 75 |
| 77 } // namespace base | 76 } // namespace base |
| 78 | 77 |
| 79 #endif // BASE_METRICS_BUCKET_RANGES_H_ | 78 #endif // BASE_METRICS_BUCKET_RANGES_H_ |
| OLD | NEW |