| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // Macros for adding samples to a named histogram. | 63 // Macros for adding samples to a named histogram. |
| 64 | 64 |
| 65 // Histogram for counters (exponentially spaced buckets). | 65 // Histogram for counters (exponentially spaced buckets). |
| 66 #define RTC_HISTOGRAM_COUNTS_100(name, sample) \ | 66 #define RTC_HISTOGRAM_COUNTS_100(name, sample) \ |
| 67 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100, 50) | 67 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100, 50) |
| 68 | 68 |
| 69 #define RTC_HISTOGRAM_COUNTS_200(name, sample) \ | 69 #define RTC_HISTOGRAM_COUNTS_200(name, sample) \ |
| 70 RTC_HISTOGRAM_COUNTS(name, sample, 1, 200, 50) | 70 RTC_HISTOGRAM_COUNTS(name, sample, 1, 200, 50) |
| 71 | 71 |
| 72 #define RTC_HISTOGRAM_COUNTS_500(name, sample) \ |
| 73 RTC_HISTOGRAM_COUNTS(name, sample, 1, 500, 50) |
| 74 |
| 72 #define RTC_HISTOGRAM_COUNTS_1000(name, sample) \ | 75 #define RTC_HISTOGRAM_COUNTS_1000(name, sample) \ |
| 73 RTC_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50) | 76 RTC_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50) |
| 74 | 77 |
| 75 #define RTC_HISTOGRAM_COUNTS_10000(name, sample) \ | 78 #define RTC_HISTOGRAM_COUNTS_10000(name, sample) \ |
| 76 RTC_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50) | 79 RTC_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50) |
| 77 | 80 |
| 78 #define RTC_HISTOGRAM_COUNTS_100000(name, sample) \ | 81 #define RTC_HISTOGRAM_COUNTS_100000(name, sample) \ |
| 79 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100000, 50) | 82 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100000, 50) |
| 80 | 83 |
| 81 #define RTC_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \ | 84 #define RTC_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \ |
| 82 RTC_HISTOGRAM_COMMON_BLOCK(name, sample, false, \ | 85 RTC_HISTOGRAM_COMMON_BLOCK(name, sample, false, \ |
| 83 webrtc::metrics::HistogramFactoryGetCounts(name, min, max, bucket_count)) | 86 webrtc::metrics::HistogramFactoryGetCounts(name, min, max, bucket_count)) |
| 84 | 87 |
| 85 // RTC_HISTOGRAM_COUNTS with logging. | 88 // RTC_HISTOGRAM_COUNTS with logging. |
| 86 #define RTC_LOGGED_HISTOGRAM_COUNTS_100(name, sample) \ | 89 #define RTC_LOGGED_HISTOGRAM_COUNTS_100(name, sample) \ |
| 87 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 100, 50) | 90 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 100, 50) |
| 88 | 91 |
| 89 #define RTC_LOGGED_HISTOGRAM_COUNTS_200(name, sample) \ | 92 #define RTC_LOGGED_HISTOGRAM_COUNTS_200(name, sample) \ |
| 90 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 200, 50) | 93 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 200, 50) |
| 91 | 94 |
| 95 #define RTC_LOGGED_HISTOGRAM_COUNTS_500(name, sample) \ |
| 96 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 500, 50) |
| 97 |
| 92 #define RTC_LOGGED_HISTOGRAM_COUNTS_1000(name, sample) \ | 98 #define RTC_LOGGED_HISTOGRAM_COUNTS_1000(name, sample) \ |
| 93 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50) | 99 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50) |
| 94 | 100 |
| 95 #define RTC_LOGGED_HISTOGRAM_COUNTS_10000(name, sample) \ | 101 #define RTC_LOGGED_HISTOGRAM_COUNTS_10000(name, sample) \ |
| 96 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50) | 102 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50) |
| 97 | 103 |
| 98 #define RTC_LOGGED_HISTOGRAM_COUNTS_100000(name, sample) \ | 104 #define RTC_LOGGED_HISTOGRAM_COUNTS_100000(name, sample) \ |
| 99 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 100000, 50) | 105 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 100000, 50) |
| 100 | 106 |
| 101 #define RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \ | 107 #define RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, min, max, bucket_count) \ |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // Macros for calling a histogram with varying name (e.g. when using a metric | 174 // Macros for calling a histogram with varying name (e.g. when using a metric |
| 169 // in different modes such as real-time vs screenshare). | 175 // in different modes such as real-time vs screenshare). |
| 170 #define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) \ | 176 #define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) \ |
| 171 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 177 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 172 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100, 50)) | 178 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100, 50)) |
| 173 | 179 |
| 174 #define RTC_HISTOGRAMS_COUNTS_200(index, name, sample) \ | 180 #define RTC_HISTOGRAMS_COUNTS_200(index, name, sample) \ |
| 175 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 181 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 176 RTC_HISTOGRAM_COUNTS(name, sample, 1, 200, 50)) | 182 RTC_HISTOGRAM_COUNTS(name, sample, 1, 200, 50)) |
| 177 | 183 |
| 184 #define RTC_HISTOGRAMS_COUNTS_500(index, name, sample) \ |
| 185 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 186 RTC_HISTOGRAM_COUNTS(name, sample, 1, 500, 50)) |
| 187 |
| 178 #define RTC_HISTOGRAMS_COUNTS_1000(index, name, sample) \ | 188 #define RTC_HISTOGRAMS_COUNTS_1000(index, name, sample) \ |
| 179 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 189 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 180 RTC_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50)) | 190 RTC_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50)) |
| 181 | 191 |
| 182 #define RTC_HISTOGRAMS_COUNTS_10000(index, name, sample) \ | 192 #define RTC_HISTOGRAMS_COUNTS_10000(index, name, sample) \ |
| 183 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 193 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 184 RTC_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50)) | 194 RTC_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50)) |
| 185 | 195 |
| 186 #define RTC_HISTOGRAMS_COUNTS_100000(index, name, sample) \ | 196 #define RTC_HISTOGRAMS_COUNTS_100000(index, name, sample) \ |
| 187 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 197 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 188 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100000, 50)) | 198 RTC_HISTOGRAM_COUNTS(name, sample, 1, 100000, 50)) |
| 189 | 199 |
| 190 #define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \ | 200 #define RTC_HISTOGRAMS_ENUMERATION(index, name, sample, boundary) \ |
| 191 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 201 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 192 RTC_HISTOGRAM_ENUMERATION(name, sample, boundary)) | 202 RTC_HISTOGRAM_ENUMERATION(name, sample, boundary)) |
| 193 | 203 |
| 194 #define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) \ | 204 #define RTC_HISTOGRAMS_PERCENTAGE(index, name, sample) \ |
| 195 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 205 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 196 RTC_HISTOGRAM_PERCENTAGE(name, sample)) | 206 RTC_HISTOGRAM_PERCENTAGE(name, sample)) |
| 197 | 207 |
| 198 // RTC_HISTOGRAMS_COUNTS with logging. | 208 // RTC_HISTOGRAMS_COUNTS with logging. |
| 199 #define RTC_LOGGED_HISTOGRAMS_COUNTS_100(index, name, sample) \ | 209 #define RTC_LOGGED_HISTOGRAMS_COUNTS_100(index, name, sample) \ |
| 200 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 210 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 201 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 100, 50)) | 211 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 100, 50)) |
| 202 | 212 |
| 203 #define RTC_LOGGED_HISTOGRAMS_COUNTS_200(index, name, sample) \ | 213 #define RTC_LOGGED_HISTOGRAMS_COUNTS_200(index, name, sample) \ |
| 204 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 214 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 205 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 200, 50)) | 215 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 200, 50)) |
| 206 | 216 |
| 217 #define RTC_LOGGED_HISTOGRAMS_COUNTS_500(index, name, sample) \ |
| 218 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 219 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 500, 50)) |
| 220 |
| 207 #define RTC_LOGGED_HISTOGRAMS_COUNTS_1000(index, name, sample) \ | 221 #define RTC_LOGGED_HISTOGRAMS_COUNTS_1000(index, name, sample) \ |
| 208 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 222 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 209 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50)) | 223 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 1000, 50)) |
| 210 | 224 |
| 211 #define RTC_LOGGED_HISTOGRAMS_COUNTS_10000(index, name, sample) \ | 225 #define RTC_LOGGED_HISTOGRAMS_COUNTS_10000(index, name, sample) \ |
| 212 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 226 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| 213 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50)) | 227 RTC_LOGGED_HISTOGRAM_COUNTS(name, sample, 1, 10000, 50)) |
| 214 | 228 |
| 215 #define RTC_LOGGED_HISTOGRAMS_COUNTS_100000(index, name, sample) \ | 229 #define RTC_LOGGED_HISTOGRAMS_COUNTS_100000(index, name, sample) \ |
| 216 RTC_HISTOGRAMS_COMMON(index, name, sample, \ | 230 RTC_HISTOGRAMS_COMMON(index, name, sample, \ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // Function for adding a |sample| to a histogram. | 279 // Function for adding a |sample| to a histogram. |
| 266 // |name| can be used to verify that it matches the histogram name. | 280 // |name| can be used to verify that it matches the histogram name. |
| 267 void HistogramAdd( | 281 void HistogramAdd( |
| 268 Histogram* histogram_pointer, const std::string& name, int sample); | 282 Histogram* histogram_pointer, const std::string& name, int sample); |
| 269 | 283 |
| 270 } // namespace metrics | 284 } // namespace metrics |
| 271 } // namespace webrtc | 285 } // namespace webrtc |
| 272 | 286 |
| 273 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ | 287 #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_ |
| 274 | 288 |
| OLD | NEW |