summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorJay Srinivasan <jaysri@chromium.org>2013-01-10 19:24:35 -0800
committerChromeBot <chrome-bot@google.com>2013-01-11 17:50:26 -0800
commit55f50c24c2624487b803ba2f93588494cc69e523 (patch)
tree2df7821b309db277cd9a96314a4c2c5678a120f3 /utils.h
parent95931b8f3b1b53cb337c8359c0495e2798863318 (diff)
Segregate UMA metrics for production scenarios from test scenarios.
Currently we separate the UMA metrics only by one category: whether the device is in dev mode or not. In addition, we need to exclude the noise from these two categories: 1. Most of our testing on MP-signed images which are performed with autest. 2. All our hwlab tests run in non-dev mode but they use dev-signed images with dev-firmware keys. So this CL defines additional bit fields to represent these states and if any of these three flags are set, the UMA metric is sent to a DevModeErrorCodes bucket. Thus the NormalErrorCodes bucket will have only the production errors and thus we can monitor more effectively. BUG=chromium-os:37613 TEST=Updated unit tests, ran on ZGB for all scenarios. Change-Id: Id9cce33f09d1cc50cb15e67c731f7548940cbc24 Reviewed-on: https://gerrit.chromium.org/gerrit/41103 Reviewed-by: Chris Sosa <sosa@chromium.org> Commit-Queue: Jay Srinivasan <jaysri@chromium.org> Tested-by: Jay Srinivasan <jaysri@chromium.org>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/utils.h b/utils.h
index c2cd21db..6c178537 100644
--- a/utils.h
+++ b/utils.h
@@ -23,6 +23,8 @@
namespace chromeos_update_engine {
+class SystemState;
+
namespace utils {
// Returns true if this is an official Chrome OS build, false otherwise.
@@ -286,11 +288,15 @@ std::string FormatTimeDelta(base::TimeDelta delta);
// it'll return the same value again.
ActionExitCode GetBaseErrorCode(ActionExitCode code);
-// Sends the error code to the appropriate bucket in UMA using the metrics_lib
-// interface. This method uses GetBaseErrorCode to process the given code and
-// report only the base error code.
-void SendErrorCodeToUma(MetricsLibraryInterface* metrics_lib,
- ActionExitCode code);
+// Sends the error code to UMA using the metrics interface object in the given
+// system state. It also uses the system state to determine the right UMA
+// bucket for the error code.
+void SendErrorCodeToUma(SystemState* system_state, ActionExitCode code);
+
+// Returns a string representation of the ActionExitCodes (either the base
+// error codes or the bit flags) for logging purposes.
+std::string CodeToString(ActionExitCode code);
+
} // namespace utils