Chromium Code Reviews| Index: base/metrics/histogram_macros_internal.h |
| diff --git a/base/metrics/histogram_macros_internal.h b/base/metrics/histogram_macros_internal.h |
| index 8181ead9adf00e84c209cbe1e42eb21671fb7f55..01aa216a680d80ddb6c36ae98dc45827749a1c3e 100644 |
| --- a/base/metrics/histogram_macros_internal.h |
| +++ b/base/metrics/histogram_macros_internal.h |
| @@ -8,6 +8,7 @@ |
| #include "base/atomicops.h" |
| #include "base/logging.h" |
| #include "base/metrics/histogram.h" |
| +#include "base/metrics/sparse_histogram.h" |
| #include "base/time/time.h" |
| // This is for macros internal to base/metrics. They should not be used outside |
| @@ -127,3 +128,15 @@ |
| } scoped_histogram_timer_##key |
| #endif // BASE_METRICS_HISTOGRAM_MACROS_INTERNAL_H_ |
| + |
| +// Macro for sparse histogram. |
| +// The implementation more costly to add values to, and each value |
|
rkaplow
2016/10/04 17:04:51
is more constly
nikunjb1
2016/10/05 23:52:35
Done.
|
| +// stored has more overhead, compared to the other histogram types. However it |
| +// may be more efficient in memory if the total number of sample values is small |
| +// compared to the range of their values. |
| +#define INTERNAL_HISTOGRAM_SPARSE_SLOWLY(name, sample) \ |
| + do { \ |
| + base::HistogramBase* histogram = base::SparseHistogram::FactoryGet( \ |
| + name, base::HistogramBase::kUmaTargetedHistogramFlag); \ |
| + histogram->Add(sample); \ |
| + } while (0) |