Add generic "event of interest" enumerated histogram.
This change aims to simplify the addition of events we may
want to track in the field, more specifically hard-to-reproduce
bugs. Before this change, this requires creating a new histogram
and registering it via histograms.xml, which is not in the Chrome OS
repositories. With this change, a new event just requires claiming
an event name (such as ModemManagerCommandSendFailure) in
metrics_library.cc, and running "metrics_client -v <event name>"
or calling SendCrosEventToUMA(event_name).
I can make up a bug for this. Or not.
BUG=none
TEST=compiled
Change-Id: I9c56b58310f0d22e77624edee7fe6149abd60a49
Reviewed-on: https://gerrit.chromium.org/gerrit/45322
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
diff --git a/metrics/metrics_library.h b/metrics/metrics_library.h
index 2539f02..ce6985f 100644
--- a/metrics/metrics_library.h
+++ b/metrics/metrics_library.h
@@ -90,6 +90,14 @@
// has occurred. Used by UMA to generate stability statistics.
bool SendCrashToUMA(const char *crash_kind);
+ // Sends a "generic Chrome OS event" to UMA. This is an event name
+ // that is translated into an enumerated histogram entry. Event names
+ // are added to metrics_library.cc. Optionally, they can be added
+ // to histograms.xml---but part of the reason for this is to simplify
+ // the addition of events (at the cost of having to look them up by
+ // number in the histograms dashboard).
+ bool SendCrosEventToUMA(const std::string& event);
+
// Sends to Autotest and returns true on success.
static bool SendToAutotest(const std::string& name, int value);