Addressing review comments that came after merging previous CL. Minor updates to naming conventions and comments. BUG=chromium-os:34299 TEST=Retested on ZGB. Re-ran unit tests. Change-Id: I7db665d4f69969a972ee801f0e0cea9cf33437a6 Reviewed-on: https://gerrit.chromium.org/gerrit/36531 Reviewed-by: Gilad Arnold <[email protected]> Commit-Ready: Jay Srinivasan <[email protected]> Reviewed-by: Jay Srinivasan <[email protected]> Tested-by: Jay Srinivasan <[email protected]>
diff --git a/utils.cc b/utils.cc index 1165db5..1267256 100644 --- a/utils.cc +++ b/utils.cc
@@ -31,7 +31,6 @@ #include <rootdev/rootdev.h> #include "update_engine/file_writer.h" -#include "update_engine/install_plan.h" #include "update_engine/omaha_request_params.h" #include "update_engine/subprocess.h" @@ -699,26 +698,29 @@ exp_time.second); } -void SendErrorCodeToUMA(MetricsLibraryInterface* metrics_lib, +void SendErrorCodeToUma(MetricsLibraryInterface* metrics_lib, ActionExitCode code) { - string metric = utils::IsNormalBootMode() ? "UpdateEngine.NormalErrorCodes" : - "UpdateEngine.DevModeErrorCodes"; + string metric = utils::IsNormalBootMode() ? "Installer.NormalErrorCodes" : + "Installer.DevModeErrorCodes"; // Ignore the higher order bits in the code by applying the mask as // we want the enumerations to be in the small contiguous range - // with values less than kNumBucketsForUMAMetrics. - int actual_code = code & kActualCodeMask; + // with values less than kActionCodeUmaReportedMax. + int reported_code = code & kActualCodeMask; // Make additional adjustments required for UMA. - if (actual_code >= kActionCodeOmahaRequestHTTPResponseBase) { + // TODO(jaysri): Move this logic to UeErrorCode.cc when we + // fix BUG 34369. + if (reported_code >= kActionCodeOmahaRequestHTTPResponseBase) { // Since we want to keep the enums to a small value, aggregate all HTTP // errors into this one bucket for UMA purposes. - actual_code = kActionCodeOmahaErrorInHTTPResponse; + reported_code = kActionCodeOmahaErrorInHTTPResponse; } - LOG(INFO) << "Sending " << actual_code << " to UMA metric: " << metric; - metrics_lib->SendEnumToUMA(metric, actual_code, kNumBucketsForUMAMetrics); + LOG(INFO) << "Sending error code " << reported_code + << " to UMA metric: " << metric; + metrics_lib->SendEnumToUMA(metric, reported_code, kActionCodeUmaReportedMax); }