changeset 1116:1994640176c2

7901285: JMH SingleShot mode reports "ms", while should report "ms/op"
author shade
date Mon, 02 Feb 2015 12:52:42 +0300
parents edc88191c102
children 0797222e066e
files jmh-core/src/main/java/org/openjdk/jmh/results/SingleShotResult.java jmh-core/src/test/java/org/openjdk/jmh/results/TestSingleShotResult.java
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/results/SingleShotResult.java	Fri Jan 30 13:22:48 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/results/SingleShotResult.java	Mon Feb 02 12:52:42 2015 +0300
@@ -40,7 +40,7 @@
     public SingleShotResult(ResultRole role, String label, long duration, TimeUnit outputTimeUnit) {
         this(role, label,
                 of(1.0D * duration / TimeUnit.NANOSECONDS.convert(1, outputTimeUnit)),
-                TimeValue.tuToString(outputTimeUnit));
+                TimeValue.tuToString(outputTimeUnit) + "/op");
     }
 
     SingleShotResult(ResultRole mode, String label, Statistics s, String unit) {
--- a/jmh-core/src/test/java/org/openjdk/jmh/results/TestSingleShotResult.java	Fri Jan 30 13:22:48 2015 +0300
+++ b/jmh-core/src/test/java/org/openjdk/jmh/results/TestSingleShotResult.java	Mon Feb 02 12:52:42 2015 +0300
@@ -40,7 +40,7 @@
         Result result = r1.getIterationAggregator().aggregate(Arrays.asList(r1, r2));
 
         assertEquals(1.5, result.getScore());
-        assertEquals("us", result.getScoreUnit());
+        assertEquals("us/op", result.getScoreUnit());
     }
 
     @Test
@@ -50,7 +50,7 @@
         Result result = r1.getThreadAggregator().aggregate(Arrays.asList(r1, r2));
 
         assertEquals(1.5, result.getScore());
-        assertEquals("us", result.getScoreUnit());
+        assertEquals("us/op", result.getScoreUnit());
     }
 
 }