Fix two android metrics reporting in update engine
1. The AttemptCurrentBytesDownloadedMiB was reported in bytes.
2. We were using the same start timestamp (in monotonic_time) for both
boot_time and monotonic_time. This leads to an inaccurate update
duration reporting. This cl saves an extra perf for the boot time and
calculates the duration accordingly.
Also report these information with a different metrics name.
Bug: 30989466
Test: Run an update and check the report
Change-Id: I69e20648501a736a59ff60ca9202ce7bdd9b6e34
diff --git a/common/constants.cc b/common/constants.cc
index 2edfbb7..26adbe0 100644
--- a/common/constants.cc
+++ b/common/constants.cc
@@ -90,6 +90,7 @@
const char kPrefsUpdateStateSignatureBlob[] = "update-state-signature-blob";
const char kPrefsUpdateStateSignedSHA256Context[] =
"update-state-signed-sha-256-context";
+const char kPrefsUpdateBootTimestampStart[] = "update-boot-timestamp-start";
const char kPrefsUpdateTimestampStart[] = "update-timestamp-start";
const char kPrefsUrlSwitchCount[] = "url-switch-count";
const char kPrefsWallClockScatteringWaitPeriod[] = "wall-clock-wait-period";
diff --git a/common/constants.h b/common/constants.h
index d97c5fb..897d2e2 100644
--- a/common/constants.h
+++ b/common/constants.h
@@ -88,6 +88,7 @@
extern const char kPrefsUpdateStateSHA256Context[];
extern const char kPrefsUpdateStateSignatureBlob[];
extern const char kPrefsUpdateStateSignedSHA256Context[];
+extern const char kPrefsUpdateBootTimestampStart[];
extern const char kPrefsUpdateTimestampStart[];
extern const char kPrefsUrlSwitchCount[];
extern const char kPrefsWallClockScatteringWaitPeriod[];