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

Unified Diff: base/metrics/histogram_macros.h

Issue 2373523003: Clean up sparse_histogram.h header (Closed)
Patch Set: Rebase update on Oct 18 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/files/file_win.cc ('k') | base/metrics/histogram_macros_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_macros.h
diff --git a/base/metrics/histogram_macros.h b/base/metrics/histogram_macros.h
index ade89591fcf2f4588df979e746a2401634e1be00..63cca694e9ad2d3d5ab36b99b6b426f14e628692 100644
--- a/base/metrics/histogram_macros.h
+++ b/base/metrics/histogram_macros.h
@@ -10,16 +10,12 @@
#include "base/metrics/histogram_macros_local.h"
#include "base/time/time.h"
+
// Macros for efficient use of histograms.
//
// For best practices on deciding when to emit to a histogram and what form
// the histogram should take, see
// https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md
-//
-// TODO(nikunjb): Move sparse macros to this file.
-//
-// UMA_HISTOGRAM_SPARSE_SLOWLY is defined in sparse_histogram.h as it has
-// different #include dependencies.
// TODO(rkaplow): Link to proper documentation on metric creation once we have
// it in a good state.
@@ -243,6 +239,20 @@
name, sample, enum_max, \
base::HistogramBase::kUmaStabilityHistogramFlag)
+//------------------------------------------------------------------------------
+// Sparse histograms.
+
+// Sparse histograms are well suited for recording counts of exact sample values
+// that are sparsely distributed over a large range.
+//
+// UMA_HISTOGRAM_SPARSE_SLOWLY is good for sparsely distributed and/or
+// infrequently recorded values since the implementation is slower
+// and takes more memory.
+//
+// For instance, Sqlite.Version.* are sparse because for any given database,
+// there's going to be exactly one version logged.
+#define UMA_HISTOGRAM_SPARSE_SLOWLY(name, sample) \
+ INTERNAL_HISTOGRAM_SPARSE_SLOWLY(name, sample)
//------------------------------------------------------------------------------
// Deprecated histogram macros. Not recommended for current use.
« no previous file with comments | « base/files/file_win.cc ('k') | base/metrics/histogram_macros_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698