| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // HistogramBase implementation: | 197 // HistogramBase implementation: |
| 198 uint64_t name_hash() const override; | 198 uint64_t name_hash() const override; |
| 199 HistogramType GetHistogramType() const override; | 199 HistogramType GetHistogramType() const override; |
| 200 bool HasConstructionArguments(Sample expected_minimum, | 200 bool HasConstructionArguments(Sample expected_minimum, |
| 201 Sample expected_maximum, | 201 Sample expected_maximum, |
| 202 uint32_t expected_bucket_count) const override; | 202 uint32_t expected_bucket_count) const override; |
| 203 void Add(Sample value) override; | 203 void Add(Sample value) override; |
| 204 void AddCount(Sample value, int count) override; | 204 void AddCount(Sample value, int count) override; |
| 205 std::unique_ptr<HistogramSamples> SnapshotSamples() const override; | 205 std::unique_ptr<HistogramSamples> SnapshotSamples() const override; |
| 206 std::unique_ptr<HistogramSamples> SnapshotDelta() override; | 206 std::unique_ptr<HistogramSamples> SnapshotDelta() override; |
| 207 std::unique_ptr<HistogramSamples> SnapshotDifference() const override; |
| 207 void AddSamples(const HistogramSamples& samples) override; | 208 void AddSamples(const HistogramSamples& samples) override; |
| 208 bool AddSamplesFromPickle(base::PickleIterator* iter) override; | 209 bool AddSamplesFromPickle(base::PickleIterator* iter) override; |
| 209 void WriteHTMLGraph(std::string* output) const override; | 210 void WriteHTMLGraph(std::string* output) const override; |
| 210 void WriteAscii(std::string* output) const override; | 211 void WriteAscii(std::string* output) const override; |
| 211 | 212 |
| 212 protected: | 213 protected: |
| 213 // This class, defined entirely within the .cc file, contains all the | 214 // This class, defined entirely within the .cc file, contains all the |
| 214 // common logic for building a Histogram and can be overridden by more | 215 // common logic for building a Histogram and can be overridden by more |
| 215 // specific types to alter details of how the creation is done. It is | 216 // specific types to alter details of how the creation is done. It is |
| 216 // defined as an embedded class (rather than an anonymous one) so it | 217 // defined as an embedded class (rather than an anonymous one) so it |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter); | 539 static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter); |
| 539 | 540 |
| 540 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); | 541 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); |
| 541 | 542 |
| 542 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); | 543 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); |
| 543 }; | 544 }; |
| 544 | 545 |
| 545 } // namespace base | 546 } // namespace base |
| 546 | 547 |
| 547 #endif // BASE_METRICS_HISTOGRAM_H_ | 548 #endif // BASE_METRICS_HISTOGRAM_H_ |
| OLD | NEW |