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_action_unittest.cc b/omaha_request_action_unittest.cc
index e550070..c3a3f1b 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -1479,7 +1479,7 @@
const string kTestDir = "omaha_request_action-test";
ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir +
- utils::kStatefulPartition + "/etc"));
+ kStatefulPartition + "/etc"));
vector<char> post_data;
NiceMock<PrefsMock> prefs;
ASSERT_TRUE(WriteFileString(
@@ -1488,7 +1488,7 @@
"CHROMEOS_BOARD_APPID={22222222-2222-2222-2222-222222222222}\n"
"CHROMEOS_RELEASE_TRACK=canary-channel\n"));
ASSERT_TRUE(WriteFileString(
- kTestDir + utils::kStatefulPartition + "/etc/lsb-release",
+ kTestDir + kStatefulPartition + "/etc/lsb-release",
"CHROMEOS_IS_POWERWASH_ALLOWED=true\n"
"CHROMEOS_RELEASE_TRACK=stable-channel\n"));
OmahaRequestParams params = kDefaultTestParams;
@@ -1519,7 +1519,7 @@
const string kTestDir = "omaha_request_action-test";
ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir +
- utils::kStatefulPartition + "/etc"));
+ kStatefulPartition + "/etc"));
vector<char> post_data;
NiceMock<PrefsMock> prefs;
ASSERT_TRUE(WriteFileString(
@@ -1528,7 +1528,7 @@
"CHROMEOS_BOARD_APPID={22222222-2222-2222-2222-222222222222}\n"
"CHROMEOS_RELEASE_TRACK=stable-channel\n"));
ASSERT_TRUE(WriteFileString(
- kTestDir + utils::kStatefulPartition + "/etc/lsb-release",
+ kTestDir + kStatefulPartition + "/etc/lsb-release",
"CHROMEOS_RELEASE_TRACK=canary-channel\n"));
OmahaRequestParams params = kDefaultTestParams;
params.set_root(string("./") + kTestDir);