diff options
author | Steven Timotius <stimo@google.com> | 2018-02-05 11:44:41 -0800 |
---|---|---|
committer | Steven Timotius <stimo@google.com> | 2018-02-05 11:47:00 -0800 |
commit | d2962e783f1f542c456ed5220f1ced5ddb57dc9e (patch) | |
tree | bdd661144f800164fc1f4eedaaf01fb4f8b058c0 /src/com/android/loganalysis/item | |
parent | 6a5ccaef7a4bd6ff3b2d8f02ae2fc33d80af9698 (diff) | |
download | loganalysis-d2962e783f1f542c456ed5220f1ced5ddb57dc9e.tar.gz |
Add percentile fields to GfxInfoParser
Test: tools/tradefederation/core/tests/run_tradefed_tests.sh --class com.android.loganalysis.parser.GfxInfoParserTest
Bug: None
Change-Id: Id2c36af1daa3cb330aa783756a6c412e2f7f820c
Diffstat (limited to 'src/com/android/loganalysis/item')
-rw-r--r-- | src/com/android/loganalysis/item/GfxInfoItem.java | 40 |
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; + } } |