Report more android update metrics in update engine
Report more metrics with android::metricslogger.
Metrics include:
ota_update_engine_attempt_number
ota_update_engine_attempt_result
ota_update_engine_attempt_duration_in_minutes
ota_update_engine_attempt_duration_uptime_in_minutes
ota_update_engine_attempt_payload_size_mib
ota_update_engine_attempt_payload_type
ota_update_engine_successful_update_attempt_count
ota_update_engine_successful_update_total_duration_in_minutes
ota_update_engine_successful_update_payload_size_mib
ota_update_engine_successful_update_payload_type
ota_update_engine_successful_update_reboot_count
And the google3 CL in cr/review/172829231
Bug: 30989466
Test: compile update_engine for marlin
Change-Id: Ic0ead07d1bd4a575244eb5e05588b47ba7b0bafe
diff --git a/update_attempter_android.cc b/update_attempter_android.cc
index 22bb4c2..dbddfe3 100644
--- a/update_attempter_android.cc
+++ b/update_attempter_android.cc
@@ -557,13 +557,14 @@
metrics_utils::GetAttemptResult(error_code);
Time attempt_start_time = Time::FromInternalValue(
metrics_utils::GetPersistedValue(kPrefsUpdateTimestampStart, prefs_));
+ TimeDelta duration = clock_->GetBootTime() - attempt_start_time;
TimeDelta duration_uptime = clock_->GetMonotonicTime() - attempt_start_time;
metrics_reporter_->ReportUpdateAttemptMetrics(
nullptr, // system_state
static_cast<int>(attempt_number),
payload_type,
- TimeDelta(),
+ duration,
duration_uptime,
payload_size,
attempt_result,
@@ -581,7 +582,7 @@
payload_size,
nullptr, // num bytes downloaded
0, // download overhead percentage
- duration_uptime,
+ duration,
static_cast<int>(reboot_count),
0); // url_switch_count
}