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

Unified Diff: base/metrics/histogram_macros.h

Issue 2385053003: Add a basic exact linear macro. Ends up being the same as enum, but making it explicit will make ou… (Closed)
Patch Set: add mark and I as owners 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/OWNERS ('k') | no next file » | 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 9cb21ec563a2ed54e45cdd885b4d2501a84ad985..fe984bbad02cc79e729969d840768e8d94fbb18c 100644
--- a/base/metrics/histogram_macros.h
+++ b/base/metrics/histogram_macros.h
@@ -53,17 +53,26 @@
base::HistogramBase::kUmaTargetedHistogramFlag))
//------------------------------------------------------------------------------
-// Percentage histograms.
+// Linear histograms.
// All of these macros must be called with |name| as a runtime constant.
+// Used for capturing integer data with a linear bucketing scheme. This can be
+// used when you want the exact value of some small numeric count, with a max of
+// 100 or less. If you need to capture a range of greater than 100, we recommend
+// the use of the COUNT histograms below.
+
+// Sample usage:
+// UMA_HISTOGRAM_EXACT_LINEAR("Histogram.Linear", count, 10);
+#define UMA_HISTOGRAM_EXACT_LINEAR(name, sample, value_max) \
+ UMA_HISTOGRAM_ENUMERATION(name, sample, value_max+1)
+
// Used for capturing basic percentages. This will be 100 buckets of size 1.
// Sample usage:
// UMA_HISTOGRAM_PERCENTAGE("Histogram.Percent", percent_as_int);
-#define UMA_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \
- UMA_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)
-
+#define UMA_HISTOGRAM_PERCENTAGE(name, percent_as_int) \
+ UMA_HISTOGRAM_ENUMERATION(name, percent_as_int, 101)
//------------------------------------------------------------------------------
// Count histograms. These are used for collecting numeric data. Note that we
@@ -117,7 +126,6 @@
name, sample, min, max, bucket_count, \
base::HistogramBase::kUmaTargetedHistogramFlag)
-
//------------------------------------------------------------------------------
// Timing histograms. These are used for collecting timing data (generally
// latencies).
« no previous file with comments | « base/metrics/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698