Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef BASE_METRICS_HISTOGRAM_MACROS_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_MACROS_H_ |
| 6 #define BASE_METRICS_HISTOGRAM_MACROS_H_ | 6 #define BASE_METRICS_HISTOGRAM_MACROS_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 #define UMA_HISTOGRAM_COUNTS_100(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 222 #define UMA_HISTOGRAM_COUNTS_100(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 223 name, sample, 1, 100, 50) | 223 name, sample, 1, 100, 50) |
| 224 | 224 |
| 225 #define UMA_HISTOGRAM_COUNTS_1000(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 225 #define UMA_HISTOGRAM_COUNTS_1000(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 226 name, sample, 1, 1000, 50) | 226 name, sample, 1, 1000, 50) |
| 227 | 227 |
| 228 #define UMA_HISTOGRAM_COUNTS_10000(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 228 #define UMA_HISTOGRAM_COUNTS_10000(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 229 name, sample, 1, 10000, 50) | 229 name, sample, 1, 10000, 50) |
| 230 | 230 |
| 231 #define UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ | 231 #define UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ |
| 232 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ | 232 UMA_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG( \ |
| 233 base::Histogram::FactoryGet(name, min, max, bucket_count, \ | 233 name, sample, min, max, bucket_count, \ |
| 234 base::HistogramBase::kUmaTargetedHistogramFlag)) | 234 base::HistogramBase::kUmaTargetedHistogramFlag) |
| 235 | |
| 236 #define UMA_STABILITY_HISTOGRAM_COUNTS_100(name, sample) \ | |
| 237 UMA_STABILITY_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 100, 50) | |
| 238 | |
| 239 #define UMA_STABILITY_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, \ | |
| 240 bucket_count) \ | |
| 241 UMA_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG( \ | |
| 242 name, sample, min, max, bucket_count, \ | |
| 243 base::HistogramBase::kUmaStabilityHistogramFlag) | |
| 244 | |
| 245 #define UMA_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG(name, sample, min, max, \ | |
|
Alexei Svitkine (slow)
2016/09/08 18:41:12
Nit: Don't use UMA_ prefix here since the kUma fla
manzagop (departed)
2016/09/08 20:54:30
Done.
Also rewrote LOCAL_HISTOGRAM_CUSTOM_COUNTS
| |
| 246 bucket_count, flag) \ | |
| 247 STATIC_HISTOGRAM_POINTER_BLOCK( \ | |
| 248 name, Add(sample), \ | |
| 249 base::Histogram::FactoryGet(name, min, max, bucket_count, flag)) | |
| 235 | 250 |
| 236 #define UMA_HISTOGRAM_MEMORY_KB(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 251 #define UMA_HISTOGRAM_MEMORY_KB(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 237 name, sample, 1000, 500000, 50) | 252 name, sample, 1000, 500000, 50) |
| 238 | 253 |
| 239 #define UMA_HISTOGRAM_MEMORY_MB(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 254 #define UMA_HISTOGRAM_MEMORY_MB(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 240 name, sample, 1, 1000, 50) | 255 name, sample, 1, 1000, 50) |
| 241 | 256 |
| 242 #define UMA_HISTOGRAM_MEMORY_LARGE_MB(name, sample) \ | 257 #define UMA_HISTOGRAM_MEMORY_LARGE_MB(name, sample) \ |
| 243 UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 64000, 100) | 258 UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 64000, 100) |
| 244 | 259 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 UMA_HISTOGRAM_LONG_TIMES_100(name, elapsed); \ | 309 UMA_HISTOGRAM_LONG_TIMES_100(name, elapsed); \ |
| 295 } else { \ | 310 } else { \ |
| 296 UMA_HISTOGRAM_TIMES(name, elapsed); \ | 311 UMA_HISTOGRAM_TIMES(name, elapsed); \ |
| 297 } \ | 312 } \ |
| 298 } \ | 313 } \ |
| 299 private: \ | 314 private: \ |
| 300 base::TimeTicks constructed_; \ | 315 base::TimeTicks constructed_; \ |
| 301 } scoped_histogram_timer_##key | 316 } scoped_histogram_timer_##key |
| 302 | 317 |
| 303 #endif // BASE_METRICS_HISTOGRAM_MACROS_H_ | 318 #endif // BASE_METRICS_HISTOGRAM_MACROS_H_ |
| OLD | NEW |