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

Unified Diff: base/metrics/histogram_macros_internal.h

Issue 2373523003: Clean up sparse_histogram.h header (Closed)
Patch Set: Add additional file in depot which depend on sparse_histogram.h Created 4 years, 3 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
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..e779e4936f90c2a72afcd87135097c3bcdbd3194 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,12 @@
} scoped_histogram_timer_##key
#endif // BASE_METRICS_HISTOGRAM_MACROS_INTERNAL_H_
+
+// Macro for sparse histogram. Each call to add sample to sparse
+// histogram will do a lookup in map.
+#define INTERNAL_HISTOGRAM_SPARSE_SLOWLY(name, sample) \
+ do { \
+ base::HistogramBase* histogram = base::SparseHistogram::FactoryGet( \
+ name, base::HistogramBase::kUmaTargetedHistogramFlag); \
+ histogram->Add(sample); \
+ } while (0)

Powered by Google App Engine
This is Rietveld 408576698