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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 const std::vector<Sample>& custom_ranges, Flags flags); | 625 const std::vector<Sample>& custom_ranges, Flags flags); |
626 | 626 |
627 // Overridden from Histogram: | 627 // Overridden from Histogram: |
628 virtual ClassType histogram_type() const; | 628 virtual ClassType histogram_type() const; |
629 | 629 |
630 protected: | 630 protected: |
631 CustomHistogram(const std::string& name, | 631 CustomHistogram(const std::string& name, |
632 const std::vector<Sample>& custom_ranges); | 632 const std::vector<Sample>& custom_ranges); |
633 | 633 |
634 // Initialize ranges_ mapping. | 634 // Initialize ranges_ mapping. |
635 virtual void InitializeBucketRange(const std::vector<Sample>& custom_ranges); | 635 void InitializedCustomBucketRange(const std::vector<Sample>& custom_ranges); |
636 virtual double GetBucketSize(Count current, size_t i) const; | 636 virtual double GetBucketSize(Count current, size_t i) const; |
637 | 637 |
638 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); | 638 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); |
639 }; | 639 }; |
640 | 640 |
641 //------------------------------------------------------------------------------ | 641 //------------------------------------------------------------------------------ |
642 // StatisticsRecorder handles all histograms in the system. It provides a | 642 // StatisticsRecorder handles all histograms in the system. It provides a |
643 // general place for histograms to register, and supports a global API for | 643 // general place for histograms to register, and supports a global API for |
644 // accessing (i.e., dumping, or graphing) the data in all the histograms. | 644 // accessing (i.e., dumping, or graphing) the data in all the histograms. |
645 | 645 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 // Dump all known histograms to log. | 697 // Dump all known histograms to log. |
698 static bool dump_on_exit_; | 698 static bool dump_on_exit_; |
699 | 699 |
700 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); | 700 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); |
701 }; | 701 }; |
702 | 702 |
703 } // namespace base | 703 } // namespace base |
704 | 704 |
705 #endif // BASE_METRICS_HISTOGRAM_H_ | 705 #endif // BASE_METRICS_HISTOGRAM_H_ |
OLD | NEW |