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

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

Merge \\"Collect statistics of source build version\\" into nyc-dev am: 8872a604

am: 3287c5f3

Change-Id: I830db9c215867f5943dce75bd09583742916ae6b
parents ac30854a 3287c5f3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -699,6 +699,7 @@ public class RecoverySystem {
            String line = null;
            int bytesWrittenInMiB = -1, bytesStashedInMiB = -1;
            int timeTotal = -1;
            int sourceVersion = -1;
            while ((line = in.readLine()) != null) {
                // Here is an example of lines in last_install:
                // ...
@@ -733,6 +734,8 @@ public class RecoverySystem {

                if (line.startsWith("time")) {
                    timeTotal = scaled;
                } else if (line.startsWith("source_version")) {
                    sourceVersion = scaled;
                } else if (line.startsWith("bytes_written")) {
                    bytesWrittenInMiB = (bytesWrittenInMiB == -1) ? scaled :
                            bytesWrittenInMiB + scaled;
@@ -746,6 +749,9 @@ public class RecoverySystem {
            if (timeTotal != -1) {
                MetricsLogger.histogram(context, "ota_time_total", timeTotal);
            }
            if (sourceVersion != -1) {
                MetricsLogger.histogram(context, "ota_source_version", sourceVersion);
            }
            if (bytesWrittenInMiB != -1) {
                MetricsLogger.histogram(context, "ota_written_in_MiBs", bytesWrittenInMiB);
            }