Add Installer.UpdatesAbandonedCount metric
This patch adds a new metric Installer.UpdatesAbandonedCount to track
the number of update attempts that didn't complete because a newer
update was detected during the download. This is implemented by
counting the number of different responses seen since the last
successful update.
Updates are typically only abandoned if a device is suspended or
powered off while an update is happening. This can happen either
because the device was not turned on for a very long time or because
it had little or no connectivity to Omaha and/or the servers serving
the payload.
This metric will help show how many users run into this problem.
BUG=chromium:248800
TEST=New units tests + Unit tests pass + Manually tested
Change-Id: I524a380a931c2fb30916d033b7e5b0c700f57103
Reviewed-on: https://gerrit.chromium.org/gerrit/59098
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/payload_state_interface.h b/payload_state_interface.h
index cd49abf..0cfb969 100644
--- a/payload_state_interface.h
+++ b/payload_state_interface.h
@@ -79,6 +79,10 @@
// for the current response.
virtual uint32_t GetUrlSwitchCount() = 0;
+ // Returns the total number of different responses seen since the
+ // last successful update.
+ virtual int GetNumResponsesSeen() = 0;
+
// Returns the expiry time for the current backoff period.
virtual base::Time GetBackoffExpiryTime() = 0;