summaryrefslogtreecommitdiffstats
path: root/base/metrics/histogram.h
diff options
context:
space:
mode:
authorkkimlabs@chromium.org <kkimlabs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-11 14:46:45 +0000
committerkkimlabs@chromium.org <kkimlabs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-11 14:46:45 +0000
commitc778687a545aeb1ef7df04038cb84b167565f77a (patch)
tree5055fe7135736791ddb40a661283cdd0637f7850 /base/metrics/histogram.h
parentfa01e47350050ca5be93589414a21d4dc5579107 (diff)
downloadchromium_src-c778687a545aeb1ef7df04038cb84b167565f77a.zip
chromium_src-c778687a545aeb1ef7df04038cb84b167565f77a.tar.gz
chromium_src-c778687a545aeb1ef7df04038cb84b167565f77a.tar.bz2
Let MetricsService know about some Android Activities
To tune our crash states more finely, we need to track which Activity is in the foreground when Chrome is killed. Add piping to let MetricsService know when Activities are swapped in and out by the user. The CL makes MetricsService track how many times particular Activities have been launched, as well as how often Chrome was improperly closed while one of these Activities was in the foreground (i.e. crashed). These numbers are concatenated into a histogram, which is then sent to the server. BUG=321346 Review URL: https://codereview.chromium.org/137623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/metrics/histogram.h')
-rw-r--r--base/metrics/histogram.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 9845362..7a6c688 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -190,6 +190,12 @@ class Lock;
base::Histogram::FactoryGet(name, min, max, bucket_count, \
base::HistogramBase::kNoFlags))
+// This is a helper macro used by other macros and shouldn't be used directly.
+#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 HISTOGRAM_PERCENTAGE(name, under_one_hundred) \
HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)
@@ -349,9 +355,15 @@ class Lock;
// The samples should always be strictly less than |boundary_value|. For more
// details, see the comment for the |HISTOGRAM_ENUMERATION| macro, above.
#define UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value) \
- STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
- base::LinearHistogram::FactoryGet(name, 1, boundary_value, \
- boundary_value + 1, base::HistogramBase::kUmaTargetedHistogramFlag))
+ 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, \
+ base::HistogramBase::kUmaStabilityHistogramFlag)
#define UMA_HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \
STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \