changeset 273:195fb9b144cb

Add forks/measurement/warmup iterations to JSON result format.
author shade
date Mon, 25 Nov 2013 21:06:57 +0400
parents 93cbcb0f4c8c
children bebece85774c
files jmh-core/src/main/java/org/openjdk/jmh/output/results/JSONResultFormat.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/results/JSONResultFormat.java	Mon Nov 25 20:50:57 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/results/JSONResultFormat.java	Mon Nov 25 21:06:57 2013 +0400
@@ -66,8 +66,11 @@
                 pw.println("\"benchmark\" : \"" + br.getUsername() + "\",");
                 pw.println("\"mode\" : \"" + br.getMode().shortLabel() + "\",");
                 pw.println("\"threads\" : " + runResult.getParams().getThreads() + ",");
-                pw.println("\"iterations\" : " + runResult.getParams().getMeasurement().getCount() + ",");
-                pw.println("\"iterationTime\" : \"" + runResult.getParams().getMeasurement().getTime() + "\",");
+                pw.println("\"forks\" : " + runResult.getParams().getForks() + ",");
+                pw.println("\"warmupIterations\" : " + runResult.getParams().getWarmup().getCount() + ",");
+                pw.println("\"warmupTime\" : \"" + runResult.getParams().getWarmup().getTime() + "\",");
+                pw.println("\"measurementIterations\" : " + runResult.getParams().getMeasurement().getCount() + ",");
+                pw.println("\"measurementTime\" : \"" + runResult.getParams().getMeasurement().getTime() + "\",");
                 pw.println("\"primaryMetric\" : {");
                 pw.println("\"score\" : " + runResult.getPrimaryResult().getScore() + ",");
                 pw.println("\"scoreError\" : " + runResult.getPrimaryResult().getStatistics().getMeanErrorAt(0.999) + ",");
@@ -83,7 +86,7 @@
                     for (BenchResult benchResult : runResult.getRawBenchResults()) {
                         Collection<String> scores = new ArrayList<String>();
                         for (Result r : benchResult.getRawPrimaryResults()) {
-                            scores.add(String.valueOf(r.getScore()));
+                            scores.add(String.format("%.3f", r.getScore()));
                         }
                         l1.add(printMultiple(scores, "[", "]"));
                     }