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

Unified Diff: base/metrics/histogram_macros.h

Issue 2296543002: Quantify initial stability report edge cases. (Closed)
Patch Set: Change a metric's name 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
« no previous file with comments | « no previous file | components/metrics/metrics_log.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 dcde7255c8dafee8e28c09e21baf492408ea8682..1307257441f39ccbcafaf22ce41253e8cb045cbb 100644
--- a/base/metrics/histogram_macros.h
+++ b/base/metrics/histogram_macros.h
@@ -140,18 +140,25 @@
LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 10000, 50)
#define LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
- STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
- base::Histogram::FactoryGet(name, min, max, bucket_count, \
- base::HistogramBase::kNoFlags))
+ INTERNAL_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG( \
+ name, sample, min, max, bucket_count, base::HistogramBase::kNoFlags)
+
+// This is a helper macro used by other macros and shouldn't be used directly.
+#define INTERNAL_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG(name, sample, min, max, \
+ bucket_count, flag) \
+ STATIC_HISTOGRAM_POINTER_BLOCK( \
+ name, Add(sample), \
+ base::Histogram::FactoryGet(name, min, max, bucket_count, flag))
// This is a helper macro used by other macros and shouldn't be used directly.
// One additional bucket is created in the LinearHistogram for the illegal
// values >= boundary_value so that mistakes in calling the UMA enumeration
// macros can be detected.
-#define HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary, flag) \
- STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
- base::LinearHistogram::FactoryGet(name, 1, boundary, boundary + 1, \
- flag))
+#define INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary, flag) \
+ STATIC_HISTOGRAM_POINTER_BLOCK( \
+ name, Add(sample), \
+ base::LinearHistogram::FactoryGet( \
+ name, 1, boundary, boundary + 1, flag))
#define LOCAL_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \
LOCAL_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)
@@ -229,9 +236,18 @@
name, sample, 1, 10000, 50)
#define UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
- STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
- base::Histogram::FactoryGet(name, min, max, bucket_count, \
- base::HistogramBase::kUmaTargetedHistogramFlag))
+ INTERNAL_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG( \
+ name, sample, min, max, bucket_count, \
+ base::HistogramBase::kUmaTargetedHistogramFlag)
+
+#define UMA_STABILITY_HISTOGRAM_COUNTS_100(name, sample) \
+ UMA_STABILITY_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 100, 50)
+
+#define UMA_STABILITY_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, \
+ bucket_count) \
+ INTERNAL_HISTOGRAM_CUSTOM_COUNTS_WITH_FLAG( \
+ name, sample, min, max, bucket_count, \
+ base::HistogramBase::kUmaStabilityHistogramFlag)
#define UMA_HISTOGRAM_MEMORY_KB(name, sample) UMA_HISTOGRAM_CUSTOM_COUNTS( \
name, sample, 1000, 500000, 50)
@@ -253,14 +269,16 @@
// The samples should always be strictly less than |boundary_value|. For more
// details, see the comment for the |LOCAL_HISTOGRAM_ENUMERATION| macro, above.
#define UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value) \
- HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary_value, \
+ INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG( \
+ name, sample, boundary_value, \
base::HistogramBase::kUmaTargetedHistogramFlag)
// Similar to UMA_HISTOGRAM_ENUMERATION, but used for recording stability
// histograms. Use this if recording a histogram that should be part of the
// initial stability log.
#define UMA_STABILITY_HISTOGRAM_ENUMERATION(name, sample, boundary_value) \
- HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary_value, \
+ INTERNAL_HISTOGRAM_ENUMERATION_WITH_FLAG( \
+ name, sample, boundary_value, \
base::HistogramBase::kUmaStabilityHistogramFlag)
#define UMA_HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \
« no previous file with comments | « no previous file | components/metrics/metrics_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698