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/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/metrics/histogram_macros_internal.h" | 9 #include "base/metrics/histogram_macros_internal.h" |
10 #include "base/metrics/histogram_macros_local.h" | 10 #include "base/metrics/histogram_macros_local.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 | 12 |
13 // Macros for efficient use of histograms. | 13 // Macros for efficient use of histograms. |
14 // | 14 // |
15 // For best practices on deciding when to emit to a histogram and what form | 15 // For best practices on deciding when to emit to a histogram and what form |
16 // the histogram should take, see tools/metrics/histograms/README.md | 16 // the histogram should take, see |
| 17 // https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histo
grams/README.md |
17 // | 18 // |
18 // TODO(nikunjb): Move sparse macros to this file. | 19 // TODO(nikunjb): Move sparse macros to this file. |
19 // | 20 // |
20 // UMA_HISTOGRAM_SPARSE_SLOWLY is defined in sparse_histogram.h as it has | 21 // UMA_HISTOGRAM_SPARSE_SLOWLY is defined in sparse_histogram.h as it has |
21 // different #include dependencies. | 22 // different #include dependencies. |
22 | 23 |
23 // TODO(rkaplow): Link to proper documentation on metric creation once we have | 24 // TODO(rkaplow): Link to proper documentation on metric creation once we have |
24 // it in a good state. | 25 // it in a good state. |
25 | 26 |
26 // All of these macros must be called with |name| as a runtime constant - it | 27 // All of these macros must be called with |name| as a runtime constant - it |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // |custom_ranges|. See comments above CustomRanges::FactoryGet about the | 262 // |custom_ranges|. See comments above CustomRanges::FactoryGet about the |
262 // requirement of |custom_ranges|. You can use the helper function | 263 // requirement of |custom_ranges|. You can use the helper function |
263 // CustomHistogram::ArrayToCustomRanges to transform a C-style array of valid | 264 // CustomHistogram::ArrayToCustomRanges to transform a C-style array of valid |
264 // sample values to a std::vector<int>. | 265 // sample values to a std::vector<int>. |
265 #define UMA_HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ | 266 #define UMA_HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ |
266 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ | 267 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ |
267 base::CustomHistogram::FactoryGet(name, custom_ranges, \ | 268 base::CustomHistogram::FactoryGet(name, custom_ranges, \ |
268 base::HistogramBase::kUmaTargetedHistogramFlag)) | 269 base::HistogramBase::kUmaTargetedHistogramFlag)) |
269 | 270 |
270 #endif // BASE_METRICS_HISTOGRAM_MACROS_H_ | 271 #endif // BASE_METRICS_HISTOGRAM_MACROS_H_ |
OLD | NEW |