| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 void WriteAsciiHeader(const SampleVector& samples, | 504 void WriteAsciiHeader(const SampleVector& samples, |
| 505 Count sample_count, | 505 Count sample_count, |
| 506 std::string* output) const; | 506 std::string* output) const; |
| 507 | 507 |
| 508 // Write information about previous, current, and next buckets. | 508 // Write information about previous, current, and next buckets. |
| 509 // Information such as cumulative percentage, etc. | 509 // Information such as cumulative percentage, etc. |
| 510 void WriteAsciiBucketContext(const int64 past, const Count current, | 510 void WriteAsciiBucketContext(const int64 past, const Count current, |
| 511 const int64 remaining, const size_t i, | 511 const int64 remaining, const size_t i, |
| 512 std::string* output) const; | 512 std::string* output) const; |
| 513 | 513 |
| 514 // Write textual description of the bucket contents (relative to histogram). | |
| 515 // Output is the count in the buckets, as well as the percentage. | |
| 516 void WriteAsciiBucketValue(Count current, double scaled_sum, | |
| 517 std::string* output) const; | |
| 518 | |
| 519 // Produce actual graph (set of blank vs non blank char's) for a bucket. | |
| 520 void WriteAsciiBucketGraph(double current_size, double max_size, | |
| 521 std::string* output) const; | |
| 522 | |
| 523 // WriteJSON calls these. | 514 // WriteJSON calls these. |
| 524 virtual void GetParameters(DictionaryValue* params) const OVERRIDE; | 515 virtual void GetParameters(DictionaryValue* params) const OVERRIDE; |
| 525 | 516 |
| 526 virtual void GetCountAndBucketData(Count* count, | 517 virtual void GetCountAndBucketData(Count* count, |
| 527 ListValue* buckets) const OVERRIDE; | 518 ListValue* buckets) const OVERRIDE; |
| 528 | 519 |
| 529 // Does not own this object. Should get from StatisticsRecorder. | 520 // Does not own this object. Should get from StatisticsRecorder. |
| 530 const BucketRanges* bucket_ranges_; | 521 const BucketRanges* bucket_ranges_; |
| 531 | 522 |
| 532 Sample declared_min_; // Less than this goes into counts_[0] | 523 Sample declared_min_; // Less than this goes into counts_[0] |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); | 669 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); |
| 679 static BucketRanges* CreateBucketRangesFromCustomRanges( | 670 static BucketRanges* CreateBucketRangesFromCustomRanges( |
| 680 const std::vector<Sample>& custom_ranges); | 671 const std::vector<Sample>& custom_ranges); |
| 681 | 672 |
| 682 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); | 673 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); |
| 683 }; | 674 }; |
| 684 | 675 |
| 685 } // namespace base | 676 } // namespace base |
| 686 | 677 |
| 687 #endif // BASE_METRICS_HISTOGRAM_H_ | 678 #endif // BASE_METRICS_HISTOGRAM_H_ |
| OLD | NEW |