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/real_system_state.h b/real_system_state.h
index ecb2fc0..72a07ad 100644
--- a/real_system_state.h
+++ b/real_system_state.h
@@ -64,6 +64,10 @@
return &request_params_;
}
+ virtual inline bool system_rebooted(){
+ return system_rebooted_;
+ }
+
// Initializes this concrete object. Other methods should be invoked only
// if the object has been initialized successfully.
bool Initialize(bool enable_gpio);
@@ -101,6 +105,11 @@
// Common parameters for all Omaha requests.
OmahaRequestParams request_params_;
+
+ // If true, this is the first instance of the update engine since the system
+ // rebooted. Important for tracking whether you are running instance of the
+ // update engine on first boot or due to a crash/restart.
+ bool system_rebooted_;
};
} // namespace chromeos_update_engine