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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 // Support histograming of an enumerated value. Samples should be one of the | 210 // Support histograming of an enumerated value. Samples should be one of the |
211 // std::vector<int> list provided via |custom_ranges|. See comments above | 211 // std::vector<int> list provided via |custom_ranges|. See comments above |
212 // CustomRanges::FactoryGet about the requirement of |custom_ranges|. | 212 // CustomRanges::FactoryGet about the requirement of |custom_ranges|. |
213 // You can use the helper function CustomHistogram::ArrayToCustomRanges to | 213 // You can use the helper function CustomHistogram::ArrayToCustomRanges to |
214 // transform a C-style array of valid sample values to a std::vector<int>. | 214 // transform a C-style array of valid sample values to a std::vector<int>. |
215 #define HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ | 215 #define HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ |
216 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ | 216 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ |
217 base::CustomHistogram::FactoryGet(name, custom_ranges, \ | 217 base::CustomHistogram::FactoryGet(name, custom_ranges, \ |
218 base::HistogramBase::kNoFlags)) | 218 base::HistogramBase::kNoFlags)) |
219 | 219 |
220 #define HISTOGRAM_MEMORY_KB(name, sample) HISTOGRAM_CUSTOM_COUNTS( \ | |
jar (doing other things)
2013/01/14 19:41:18
Do you deliberately want a histogram that is not g
marja
2013/01/14 19:42:38
Yes, we deliberately want that. The histogram is o
| |
221 name, sample, 1000, 500000, 50) | |
222 | |
220 //------------------------------------------------------------------------------ | 223 //------------------------------------------------------------------------------ |
221 // Define Debug vs non-debug flavors of macros. | 224 // Define Debug vs non-debug flavors of macros. |
222 #ifndef NDEBUG | 225 #ifndef NDEBUG |
223 | 226 |
224 #define DHISTOGRAM_TIMES(name, sample) HISTOGRAM_TIMES(name, sample) | 227 #define DHISTOGRAM_TIMES(name, sample) HISTOGRAM_TIMES(name, sample) |
225 #define DHISTOGRAM_COUNTS(name, sample) HISTOGRAM_COUNTS(name, sample) | 228 #define DHISTOGRAM_COUNTS(name, sample) HISTOGRAM_COUNTS(name, sample) |
226 #define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) HISTOGRAM_PERCENTAGE(\ | 229 #define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) HISTOGRAM_PERCENTAGE(\ |
227 name, under_one_hundred) | 230 name, under_one_hundred) |
228 #define DHISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ | 231 #define DHISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ |
229 HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) | 232 HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); | 705 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); |
703 static BucketRanges* CreateBucketRangesFromCustomRanges( | 706 static BucketRanges* CreateBucketRangesFromCustomRanges( |
704 const std::vector<Sample>& custom_ranges); | 707 const std::vector<Sample>& custom_ranges); |
705 | 708 |
706 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); | 709 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); |
707 }; | 710 }; |
708 | 711 |
709 } // namespace base | 712 } // namespace base |
710 | 713 |
711 #endif // BASE_METRICS_HISTOGRAM_H_ | 714 #endif // BASE_METRICS_HISTOGRAM_H_ |
OLD | NEW |