Add update reboot metric to the update engine.
This change add the Installer.UpdateNumReboots metric.
This records the number of reboots that occurred while an update was being
attempted. It uses a marker file stored in tmp to discover whether or not
it's already recorded the reboot.
BUG=chromium:226766
TEST=Unittests | ran an update on a test machine and rebooted/resumed and
checked about:histograms to confirm numbers. Also restart update-engine to
verify it didn't double count that.
Change-Id: I5d2af9d5b62a9d974c7c6243a89cb3359051b650
Reviewed-on: https://gerrit.chromium.org/gerrit/47710
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
diff --git a/omaha_request_params.cc b/omaha_request_params.cc
index 591a6f6..f30e771 100644
--- a/omaha_request_params.cc
+++ b/omaha_request_params.cc
@@ -15,6 +15,7 @@
#include <base/file_util.h>
#include <policy/device_policy.h>
+#include "update_engine/constants.h"
#include "update_engine/simple_key_value_store.h"
#include "update_engine/system_state.h"
#include "update_engine/utils.h"
@@ -132,7 +133,7 @@
}
TEST_AND_RETURN_FALSE(IsValidChannel(new_target_channel));
- FilePath kFile(root_ + utils::kStatefulPartition + "/etc/lsb-release");
+ FilePath kFile(root_ + kStatefulPartition + "/etc/lsb-release");
string file_data;
map<string, string> data;
if (file_util::ReadFileToString(kFile, &file_data)) {
@@ -213,7 +214,7 @@
bool stateful_override) const {
vector<string> files;
if (stateful_override) {
- files.push_back(string(utils::kStatefulPartition) + "/etc/lsb-release");
+ files.push_back(string(kStatefulPartition) + "/etc/lsb-release");
}
files.push_back("/etc/lsb-release");
for (vector<string>::const_iterator it = files.begin();