diff options
| author | Tianjie Xu <xunchang@google.com> | 2016-06-10 17:23:25 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2016-06-10 17:23:25 +0000 |
| commit | 9331178a6d8c77da1b099a47ca2a645f1f01e3a8 (patch) | |
| tree | 80b8e68865fc3738a1f58d03275bc111f1d46e71 /core/java/android/os/RecoverySystem.java | |
| parent | 0814666bec852341bba0306872dd300b4efcbbac (diff) | |
| parent | 8872a604b9d1d547ad48f82ecd097b79c189132c (diff) | |
Merge \"Collect statistics of source build version\" into nyc-dev
am: 8872a604b9
Change-Id: Ic920aced4f17c31a09bea55480f92252f20d728d
Diffstat (limited to 'core/java/android/os/RecoverySystem.java')
| -rw-r--r-- | core/java/android/os/RecoverySystem.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/os/RecoverySystem.java b/core/java/android/os/RecoverySystem.java index 83a3bd8409e1..cc273580bc21 100644 --- a/core/java/android/os/RecoverySystem.java +++ b/core/java/android/os/RecoverySystem.java @@ -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); } |
