| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Histogram is an object that aggregates statistics, and can summarize them in | 5 // Histogram is an object that aggregates statistics, and can summarize them in |
| 6 // various forms, including ASCII graphical, HTML, and numerically (as a | 6 // various forms, including ASCII graphical, HTML, and numerically (as a |
| 7 // vector of numbers corresponding to each of the aggregating buckets). | 7 // vector of numbers corresponding to each of the aggregating buckets). |
| 8 | 8 |
| 9 // It supports calls to accumulate either time intervals (which are processed | 9 // It supports calls to accumulate either time intervals (which are processed |
| 10 // as integral number of milliseconds), or arbitrary integral units. | 10 // as integral number of milliseconds), or arbitrary integral units. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 class BooleanHistogram; | 234 class BooleanHistogram; |
| 235 class CustomHistogram; | 235 class CustomHistogram; |
| 236 class Histogram; | 236 class Histogram; |
| 237 class LinearHistogram; | 237 class LinearHistogram; |
| 238 | 238 |
| 239 class Histogram : public base::RefCountedThreadSafe<Histogram> { | 239 class Histogram : public base::RefCountedThreadSafe<Histogram> { |
| 240 public: | 240 public: |
| 241 typedef int Sample; // Used for samples (and ranges of samples). | 241 typedef int Sample; // Used for samples (and ranges of samples). |
| 242 typedef int Count; // Used to count samples in a bucket. | 242 typedef int Count; // Used to count samples in a bucket. |
| 243 static const Sample kSampleType_MAX = INT_MAX; | 243 static const Sample kSampleType_MAX = INT_MAX; |
| 244 // Initialize maximum number of buckets in histograms as 10,000. | 244 // Initialize maximum number of buckets in histograms as 16,384. |
| 245 static const size_t kBucketCount_MAX; | 245 static const size_t kBucketCount_MAX; |
| 246 | 246 |
| 247 typedef std::vector<Count> Counts; | 247 typedef std::vector<Count> Counts; |
| 248 typedef std::vector<Sample> Ranges; | 248 typedef std::vector<Sample> Ranges; |
| 249 | 249 |
| 250 // These enums are used to facilitate deserialization of renderer histograms | 250 // These enums are used to facilitate deserialization of renderer histograms |
| 251 // into the browser. | 251 // into the browser. |
| 252 enum ClassType { | 252 enum ClassType { |
| 253 HISTOGRAM, | 253 HISTOGRAM, |
| 254 LINEAR_HISTOGRAM, | 254 LINEAR_HISTOGRAM, |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 698 |
| 699 // Dump all known histograms to log. | 699 // Dump all known histograms to log. |
| 700 static bool dump_on_exit_; | 700 static bool dump_on_exit_; |
| 701 | 701 |
| 702 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); | 702 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); |
| 703 }; | 703 }; |
| 704 | 704 |
| 705 } // namespace base | 705 } // namespace base |
| 706 | 706 |
| 707 #endif // BASE_METRICS_HISTOGRAM_H_ | 707 #endif // BASE_METRICS_HISTOGRAM_H_ |
| OLD | NEW |