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 // 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // Most commonly this is the numeric value, but in derived classes it may | 520 // Most commonly this is the numeric value, but in derived classes it may |
521 // be a name (or string description) given to the bucket. | 521 // be a name (or string description) given to the bucket. |
522 virtual const std::string GetAsciiBucketRange(size_t it) const; | 522 virtual const std::string GetAsciiBucketRange(size_t it) const; |
523 | 523 |
524 private: | 524 private: |
525 // Allow tests to corrupt our innards for testing purposes. | 525 // Allow tests to corrupt our innards for testing purposes. |
526 FRIEND_TEST_ALL_PREFIXES(HistogramTest, BoundsTest); | 526 FRIEND_TEST_ALL_PREFIXES(HistogramTest, BoundsTest); |
527 FRIEND_TEST_ALL_PREFIXES(HistogramTest, BucketPlacementTest); | 527 FRIEND_TEST_ALL_PREFIXES(HistogramTest, BucketPlacementTest); |
528 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptBucketBounds); | 528 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptBucketBounds); |
529 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts); | 529 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts); |
| 530 FRIEND_TEST_ALL_PREFIXES(HistogramTest, NameMatchTest); |
530 | 531 |
531 friend class StatisticsRecorder; // To allow it to delete duplicates. | 532 friend class StatisticsRecorder; // To allow it to delete duplicates. |
532 friend class StatisticsRecorderTest; | 533 friend class StatisticsRecorderTest; |
533 | 534 |
534 // Implementation of SnapshotSamples function. | 535 // Implementation of SnapshotSamples function. |
535 scoped_ptr<SampleVector> SnapshotSampleVector() const; | 536 scoped_ptr<SampleVector> SnapshotSampleVector() const; |
536 | 537 |
537 //---------------------------------------------------------------------------- | 538 //---------------------------------------------------------------------------- |
538 // Helpers for emitting Ascii graphic. Each method appends data to output. | 539 // Helpers for emitting Ascii graphic. Each method appends data to output. |
539 | 540 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); | 704 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); |
704 static BucketRanges* CreateBucketRangesFromCustomRanges( | 705 static BucketRanges* CreateBucketRangesFromCustomRanges( |
705 const std::vector<Sample>& custom_ranges); | 706 const std::vector<Sample>& custom_ranges); |
706 | 707 |
707 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); | 708 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); |
708 }; | 709 }; |
709 | 710 |
710 } // namespace base | 711 } // namespace base |
711 | 712 |
712 #endif // BASE_METRICS_HISTOGRAM_H_ | 713 #endif // BASE_METRICS_HISTOGRAM_H_ |
OLD | NEW |