OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // without shared memory at some point. | 186 // without shared memory at some point. |
187 int64 sum_; // sum of samples. | 187 int64 sum_; // sum of samples. |
188 int64 square_sum_; // sum of squares of samples. | 188 int64 square_sum_; // sum of squares of samples. |
189 }; | 189 }; |
190 //---------------------------------------------------------------------------- | 190 //---------------------------------------------------------------------------- |
191 | 191 |
192 Histogram(const wchar_t* name, Sample minimum, | 192 Histogram(const wchar_t* name, Sample minimum, |
193 Sample maximum, size_t bucket_count); | 193 Sample maximum, size_t bucket_count); |
194 Histogram(const wchar_t* name, TimeDelta minimum, | 194 Histogram(const wchar_t* name, TimeDelta minimum, |
195 TimeDelta maximum, size_t bucket_count); | 195 TimeDelta maximum, size_t bucket_count); |
196 ~Histogram(); | 196 virtual ~Histogram(); |
197 | 197 |
198 // Hooks to override stats counter methods. This ensures that we gather all | 198 // Hooks to override stats counter methods. This ensures that we gather all |
199 // input the stats counter sees. | 199 // input the stats counter sees. |
200 virtual void Add(int value); | 200 virtual void Add(int value); |
201 | 201 |
202 // The following methods provide a graphical histogram displays. | 202 // The following methods provide a graphical histogram displays. |
203 void WriteHTMLGraph(std::string* output) const; | 203 void WriteHTMLGraph(std::string* output) const; |
204 void WriteAscii(bool graph_it, const std::string& newline, | 204 void WriteAscii(bool graph_it, const std::string& newline, |
205 std::string* output) const; | 205 std::string* output) const; |
206 | 206 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 static Lock* lock_; | 436 static Lock* lock_; |
437 | 437 |
438 // Dump all known histograms to log. | 438 // Dump all known histograms to log. |
439 static bool dump_on_exit_; | 439 static bool dump_on_exit_; |
440 | 440 |
441 DISALLOW_EVIL_CONSTRUCTORS(StatisticsRecorder); | 441 DISALLOW_EVIL_CONSTRUCTORS(StatisticsRecorder); |
442 }; | 442 }; |
443 | 443 |
444 #endif // BASE_HISTOGRAM_H__ | 444 #endif // BASE_HISTOGRAM_H__ |
445 | 445 |
OLD | NEW |