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/payload_state_interface.h b/payload_state_interface.h
index 76b847a..e092290 100644
--- a/payload_state_interface.h
+++ b/payload_state_interface.h
@@ -40,6 +40,9 @@
// able to make forward progress with the current URL.
virtual void DownloadProgress(size_t count) = 0;
+ // This method should be called every time we resume an update attempt.
+ virtual void UpdateResumed() = 0;
+
// This method should be called every time we begin a new update. This method
// should not be called when we resume an update from the previously
// downloaded point. This is used to reset the metrics for each new update.
@@ -99,6 +102,9 @@
// source since the the last successful update. This is used to compute the
// overhead we incur.
virtual uint64_t GetTotalBytesDownloaded(DownloadSource source) = 0;
+
+ // Returns the reboot count for this update attempt.
+ virtual uint32_t GetNumReboots() = 0;
};
} // namespace chromeos_update_engine