Mercurial > hg > gc-bench
changeset 38:a8d82333b825
Rehash metrics gathered for GC tests.
author | shade |
---|---|
date | Tue, 06 Dec 2016 16:01:43 +0100 |
parents | 01d80497be8b |
children | 38ca81a5aa35 |
files | src/main/java/org/openjdk/gcbench/tests/DimensionalTest.java |
diffstat | 1 files changed, 30 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/org/openjdk/gcbench/tests/DimensionalTest.java Tue Dec 06 15:00:42 2016 +0100 +++ b/src/main/java/org/openjdk/gcbench/tests/DimensionalTest.java Tue Dec 06 16:01:43 2016 +0100 @@ -6,9 +6,7 @@ import org.openjdk.jmh.results.RunResult; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; -import org.openjdk.jmh.runner.options.ChainedOptionsBuilder; -import org.openjdk.jmh.runner.options.Options; -import org.openjdk.jmh.runner.options.OptionsBuilder; +import org.openjdk.jmh.runner.options.*; import java.util.Map; @@ -48,11 +46,12 @@ pw.printf("%-15s ", "Target rate"); } - pw.printf("%-35s %-25s %-53s %-53s %n", + pw.printf("%-35s %-25s %-7s %-47s %-47s%n", "Work rate", "Allocation rate", - "Pauses (sum, 99%, 99.9%, 99.99%)", - "TTSP (sum, 99%, 99.9%, 99.99%)" + "Pauses", + "Pause time (perc-total, sum, 99%, max)", + "TTSP (perc-of-pause, sum, 99%, max)" ); Object lastKeyVal = null; @@ -155,17 +154,18 @@ Result prim = result.getPrimaryResult(); Map<String, Result> sec = result.getSecondaryResults(); - pw.printf("%-35s %-25s %12s %12s %12s %12s %12s %12s %12s %12s %n", + pw.printf("%-35s %-25s %-6s %8s %12s %12s %12s %8s %12s %12s %12s %n", shortVal(prim), shortVal(sec.get("·gc.alloc.rate")), + intVal(sec.get("·safepoints.pause.count")), + percentRatioVal(sec.get("·safepoints.pause"), sec.get("·safepoints.interval")), latencyVal(sec.get("·safepoints.pause")), latencyVal(sec.get("·safepoints.pause.p0.99")), - latencyVal(sec.get("·safepoints.pause.p0.999")), - latencyVal(sec.get("·safepoints.pause.p0.9999")), + latencyVal(sec.get("·safepoints.pause.p1.00")), + percentRatioVal(sec.get("·safepoints.ttsp"), sec.get("·safepoints.pause")), latencyVal(sec.get("·safepoints.ttsp")), latencyVal(sec.get("·safepoints.ttsp.p0.99")), - latencyVal(sec.get("·safepoints.ttsp.p0.999")), - latencyVal(sec.get("·safepoints.ttsp.p0.9999")) + latencyVal(sec.get("·safepoints.ttsp.p1.00")) ); } catch (RunnerException e) { pw.print("FAILED: "); @@ -182,6 +182,25 @@ } } + private String percentRatioVal(Result r1, Result r2) { + if (r1 != null && r2 != null) { + return String.format("%.2f %%", 100D * r1.getScore() / r2.getScore()); + } + return "-"; + } + + private String intVal(Result r) { + if (r != null) { + if (!Double.isNaN(r.getScoreError())) { + return String.format("%d ± %d", Math.round(r.getScore()), Math.round(r.getScoreError())); + } else { + return String.format("%d", Math.round(r.getScore())); + } + } else { + return "-"; + } + } + private String shortVal(Result r) { if (r != null) { if (!Double.isNaN(r.getScoreError())) {