Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4e9efe9 authored by Tianjie Xu's avatar Tianjie Xu Committed by android-build-merger
Browse files

Collect status on uncrypt time cost

am: 492450c8

Change-Id: I17f7f1f61e132059d1f6eb260db5ad5899b9dea8
parents ae515434 492450c8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);
            }