Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: base/metrics/histogram_macros_internal.h

Issue 2373523003: Clean up sparse_histogram.h header (Closed)
Patch Set: merged Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram_macros.h ('k') | base/metrics/sparse_histogram.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « base/metrics/histogram_macros.h ('k') | base/metrics/sparse_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698