summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tianjie Xu <xunchang@google.com> 2016-09-09 11:27:32 -0700
committer Tianjie Xu <xunchang@google.com> 2016-09-16 12:13:49 -0700
commit492450c88ae3e4810b4e6b4856fb1fb1bc347fa1 (patch)
tree3e96945c70507e99d4ab84c47c0c43f40657efe1
parent845096ffa36d38f010f4bc1b34c7891ccaf74e93 (diff)
Collect status on uncrypt time cost
Read and report time cost of uncrypt (in seconds) from last_install. Bug: 31383361 Change-Id: I283970c33b2a0324f2f51cde328e3e527eff7c58 (cherry picked from commit 3477efce30b1d7f6f8bd07e31d9f1befadda2a34)
-rw-r--r--core/java/android/os/RecoverySystem.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java
index 507379baaa94..90bd11fe83bc 100644
--- a/core/java/android/os/RecoverySystem.java
+++ b/core/java/android/os/RecoverySystem.java
@@ -724,6 +724,7 @@ public class RecoverySystem {
String line = null;
int bytesWrittenInMiB = -1, bytesStashedInMiB = -1;
int timeTotal = -1;
+ int uncryptTime = -1;
int sourceVersion = -1;
while ((line = in.readLine()) != null) {
// Here is an example of lines in last_install:
@@ -759,6 +760,8 @@ public class RecoverySystem {
if (line.startsWith("time")) {
timeTotal = scaled;
+ } else if (line.startsWith("uncrypt_time")) {
+ uncryptTime = scaled;
} else if (line.startsWith("source_build")) {
sourceVersion = scaled;
} else if (line.startsWith("bytes_written")) {
@@ -774,6 +777,9 @@ public class RecoverySystem {
if (timeTotal != -1) {
MetricsLogger.histogram(context, "ota_time_total", timeTotal);
}
+ if (uncryptTime != -1) {
+ MetricsLogger.histogram(context, "ota_uncrypt_time", uncryptTime);
+ }
if (sourceVersion != -1) {
MetricsLogger.histogram(context, "ota_source_version", sourceVersion);
}