Chromium Code Reviews| 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 669 PickleIterator* iter); | 669 PickleIterator* iter); |
| 670 static HistogramBase* DeserializeInfoImpl(PickleIterator* iter); | 670 static HistogramBase* DeserializeInfoImpl(PickleIterator* iter); |
| 671 | 671 |
| 672 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); | 672 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); |
| 673 static BucketRanges* CreateBucketRangesFromCustomRanges( | 673 static BucketRanges* CreateBucketRangesFromCustomRanges( |
| 674 const std::vector<Sample>& custom_ranges); | 674 const std::vector<Sample>& custom_ranges); |
| 675 | 675 |
| 676 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); | 676 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); |
| 677 }; | 677 }; |
| 678 | 678 |
| 679 | |
| 680 // DummyHistogram is an object that overrides Histogram's Add* functions | |
| 681 // to provide no functionality. This can be returned in the case of mismatched | |
| 682 // construction arguments to any of the other Histograms' FactoryGet calls. | |
| 683 class BASE_EXPORT DummyHistogram : public Histogram { | |
|
Alexei Svitkine (slow)
2014/01/17 15:40:13
I would actually define this class in an anon name
elijahtaylor1
2014/01/17 20:04:16
Done.
| |
| 684 public: | |
| 685 virtual void Add(Sample value) OVERRIDE {} | |
| 686 virtual void AddSamples(const HistogramSamples& samples) OVERRIDE {} | |
| 687 virtual bool AddSamplesFromPickle(PickleIterator* iter) OVERRIDE; | |
| 688 | |
| 689 DummyHistogram(); | |
| 690 | |
| 691 private: | |
| 692 DISALLOW_COPY_AND_ASSIGN(DummyHistogram); | |
| 693 }; | |
| 694 | |
| 695 | |
| 679 } // namespace base | 696 } // namespace base |
| 680 | 697 |
| 681 #endif // BASE_METRICS_HISTOGRAM_H_ | 698 #endif // BASE_METRICS_HISTOGRAM_H_ |
| OLD | NEW |