OLD | NEW |
1 // | 1 // |
2 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 // | 3 // |
4 // Use of this source code is governed by a BSD-style license | 4 // Use of this source code is governed by a BSD-style license |
5 // that can be found in the LICENSE file in the root of the source | 5 // that can be found in the LICENSE file in the root of the source |
6 // tree. An additional intellectual property rights grant can be found | 6 // tree. An additional intellectual property rights grant can be found |
7 // in the file PATENTS. All contributing project authors may | 7 // in the file PATENTS. All contributing project authors may |
8 // be found in the AUTHORS file in the root of the source tree. | 8 // be found in the AUTHORS file in the root of the source tree. |
9 // | 9 // |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 webrtc::metrics::HistogramFactoryGetCounts(name, min, max, bucket_count)) | 118 webrtc::metrics::HistogramFactoryGetCounts(name, min, max, bucket_count)) |
119 | 119 |
120 // Histogram for percentage (evenly spaced buckets). | 120 // Histogram for percentage (evenly spaced buckets). |
121 #define RTC_HISTOGRAM_PERCENTAGE(name, sample) \ | 121 #define RTC_HISTOGRAM_PERCENTAGE(name, sample) \ |
122 RTC_HISTOGRAM_ENUMERATION(name, sample, 101) | 122 RTC_HISTOGRAM_ENUMERATION(name, sample, 101) |
123 | 123 |
124 // RTC_HISTOGRAM_PERCENTAGE with logging. | 124 // RTC_HISTOGRAM_PERCENTAGE with logging. |
125 #define RTC_LOGGED_HISTOGRAM_PERCENTAGE(name, sample) \ | 125 #define RTC_LOGGED_HISTOGRAM_PERCENTAGE(name, sample) \ |
126 RTC_LOGGED_HISTOGRAM_ENUMERATION(name, sample, 101) | 126 RTC_LOGGED_HISTOGRAM_ENUMERATION(name, sample, 101) |
127 | 127 |
| 128 // Histogram for booleans. |
| 129 #define RTC_HISTOGRAM_BOOLEAN(name, sample) \ |
| 130 RTC_HISTOGRAM_ENUMERATION(name, sample, 2) |
| 131 |
| 132 // RTC_HISTOGRAM_BOOLEAN with logging. |
| 133 #define RTC_LOGGED_HISTOGRAM_BOOLEAN(name, sample) \ |
| 134 RTC_LOGGED_HISTOGRAM_ENUMERATION(name, sample, 2) |
| 135 |
128 // Histogram for enumerators (evenly spaced buckets). | 136 // Histogram for enumerators (evenly spaced buckets). |
129 // |boundary| should be above the max enumerator sample. | 137 // |boundary| should be above the max enumerator sample. |
130 #define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \ | 138 #define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \ |
131 RTC_HISTOGRAM_COMMON_BLOCK(name, sample, false, \ | 139 RTC_HISTOGRAM_COMMON_BLOCK(name, sample, false, \ |
132 webrtc::metrics::HistogramFactoryGetEnumeration(name, boundary)) | 140 webrtc::metrics::HistogramFactoryGetEnumeration(name, boundary)) |
133 | 141 |
134 // RTC_HISTOGRAM_ENUMERATION with logging. | 142 // RTC_HISTOGRAM_ENUMERATION with logging. |
135 #define RTC_LOGGED_HISTOGRAM_ENUMERATION(name, sample, boundary) \ | 143 #define RTC_LOGGED_HISTOGRAM_ENUMERATION(name, sample, boundary) \ |
136 RTC_HISTOGRAM_COMMON_BLOCK(name, sample, true, \ | 144 RTC_HISTOGRAM_COMMON_BLOCK(name, sample, true, \ |
137 webrtc::metrics::HistogramFactoryGetEnumeration(name, boundary)) | 145 webrtc::metrics::HistogramFactoryGetEnumeration(name, boundary)) |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // Function for adding a |sample| to a histogram. | 287 // Function for adding a |sample| to a histogram. |
280 // |name| can be used to verify that it matches the histogram name. | 288 // |name| can be used to verify that it matches the histogram name. |
281 void HistogramAdd( | 289 void HistogramAdd( |
282 Histogram* histogram_pointer, const std::string& name, int sample); | 290 Histogram* histogram_pointer, const std::string& name, int sample); |
283 | 291 |
284 } // namespace metrics | 292 } // namespace metrics |
285 } // namespace webrtc | 293 } // namespace webrtc |
286 | 294 |
287 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ | 295 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ |
288 | 296 |
OLD | NEW |