summaryrefslogtreecommitdiff
path: root/src/com/android/loganalysis/item/GfxInfoItem.java
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2018-06-08 11:09:51 -0700
committerXin Li <delphij@google.com>2018-06-08 11:09:51 -0700
commitea5bf19ee7e9b6acd639d88dc12a0d9d36e3e940 (patch)
treea94b6fa2ae3b45b3b8199181af1a2a5195183d48 /src/com/android/loganalysis/item/GfxInfoItem.java
parentf7187e0d2e37b8f8392b578c8a2f1688ad1630ba (diff)
parent527b936e377889b1eebfc4dd1d86a6ec39421587 (diff)
downloadloganalysis-ea5bf19ee7e9b6acd639d88dc12a0d9d36e3e940.tar.gz
Merge pi-dev-plus-aosp-without-vendor into stage-aosp-mastertemp_p_merge
Bug: 79597307 Change-Id: I3dbae1a7e07d8bf2eff3f50b2c02fe6f747678cb
Diffstat (limited to 'src/com/android/loganalysis/item/GfxInfoItem.java')
-rw-r--r--src/com/android/loganalysis/item/GfxInfoItem.java40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/com/android/loganalysis/item/GfxInfoItem.java b/src/com/android/loganalysis/item/GfxInfoItem.java
index 482cea3..21ff245 100644
--- a/src/com/android/loganalysis/item/GfxInfoItem.java
+++ b/src/com/android/loganalysis/item/GfxInfoItem.java
@@ -38,6 +38,12 @@ public class GfxInfoItem implements IItem {
public static final String TOTAL_FRAMES_KEY = "total_frames";
/** Constant for JSON output */
public static final String JANKY_FRAMES_KEY = "janky_frames";
+ /** Constant for JSON output */
+ public static final String PERCENTILE_90_KEY = "percentile_90";
+ /** Constant for JSON output */
+ public static final String PERCENTILE_95_KEY = "percentile_95";
+ /** Constant for JSON output */
+ public static final String PERCENTILE_99_KEY = "percentile_99";
private Map<Integer, Row> mRows = new HashMap<Integer, Row>();
@@ -45,6 +51,9 @@ public class GfxInfoItem implements IItem {
public String name;
public long totalFrames;
public long jankyFrames;
+ public int percentile90;
+ public int percentile95;
+ public int percentile99;
}
/**
@@ -76,7 +85,9 @@ public class GfxInfoItem implements IItem {
proc.put(PID_KEY, pid);
proc.put(NAME_KEY, getName(pid));
proc.put(TOTAL_FRAMES_KEY, getTotalFrames(pid));
- proc.put(JANKY_FRAMES_KEY, getJankyFrames(pid));
+ proc.put(PERCENTILE_90_KEY, getPrecentile90(pid));
+ proc.put(PERCENTILE_95_KEY, getPrecentile95(pid));
+ proc.put(PERCENTILE_99_KEY, getPrecentile99(pid));
processes.put(proc);
} catch (JSONException e) {
// ignore
@@ -106,11 +117,21 @@ public class GfxInfoItem implements IItem {
* @param totalFrames The number of total frames rendered by the process
* @param jankyFrames The number of janky frames rendered by the process
*/
- public void addRow(int pid, String name, long totalFrames, long jankyFrames) {
+ public void addRow(
+ int pid,
+ String name,
+ long totalFrames,
+ long jankyFrames,
+ int percentile90,
+ int percentile95,
+ int percentile99) {
Row row = new Row();
row.name = name;
row.totalFrames = totalFrames;
row.jankyFrames = jankyFrames;
+ row.percentile90 = percentile90;
+ row.percentile95 = percentile95;
+ row.percentile99 = percentile99;
mRows.put(pid, row);
}
@@ -134,4 +155,19 @@ public class GfxInfoItem implements IItem {
public long getJankyFrames(int pid) {
return mRows.get(pid).jankyFrames;
}
+
+ /** Get the 90th percentile value of frame times (ms) */
+ public int getPrecentile90(int pid) {
+ return mRows.get(pid).percentile90;
+ }
+
+ /** Get the 95th percentile value of frame times (ms) */
+ public int getPrecentile95(int pid) {
+ return mRows.get(pid).percentile95;
+ }
+
+ /** Get the 99th percentile value of frame times (ms) */
+ public int getPrecentile99(int pid) {
+ return mRows.get(pid).percentile99;
+ }
}