changeset 75:7b2aed5bd1ba

Rename constants in Mode.*
author shade
date Tue, 04 Jun 2013 13:46:28 +0400
parents ef0e8692fe0e
children 9965f7887601
files jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/BlackholeBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/NanotimeBench.java jmh-core/src/main/java/org/openjdk/jmh/annotations/MicroBenchmark.java jmh-core/src/main/java/org/openjdk/jmh/annotations/Mode.java jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_02_BenchmarkModes.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_07_FixtureLevelInvocation.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_08_DeadCode.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_09_Blackholes.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_10_ConstantFold.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_11_Loops.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_12_Forking.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_13_RunToRun.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_15_Asymmetric.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_16_CompilerControl.java jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_21_ConsumeCPU.java
diffstat 17 files changed, 31 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/BlackholeBench.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/BlackholeBench.java	Tue Jun 04 13:46:28 2013 +0400
@@ -38,7 +38,7 @@
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 @State(Scope.Thread)
 public class BlackholeBench {
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java	Tue Jun 04 13:46:28 2013 +0400
@@ -35,7 +35,7 @@
 
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 public class DeadCodeBench {
 
     public int x = 1;
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/NanotimeBench.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/NanotimeBench.java	Tue Jun 04 13:46:28 2013 +0400
@@ -40,13 +40,13 @@
     private long last;
 
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.AverageTimePerOp)
+    @BenchmarkMode(Mode.AverageTime)
     public long latency_avg() {
         return System.nanoTime();
     }
 
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.AverageTimePerOp)
+    @BenchmarkMode(Mode.AverageTime)
     public long granularity_avg() {
         long lst = last;
         long cur;
@@ -58,7 +58,7 @@
     }
 
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.SampleTimePerOp)
+    @BenchmarkMode(Mode.SampleTime)
     public long granularity() {
         long lst = last;
         long cur;
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/MicroBenchmark.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/MicroBenchmark.java	Tue Jun 04 13:46:28 2013 +0400
@@ -48,6 +48,6 @@
      * Type of benchmark.
      * See {@link Mode} for available benchmark types.
      */
-    public Mode value() default Mode.OpsPerTimeUnit;
+    public Mode value() default Mode.Throughput;
 
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Mode.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Mode.java	Tue Jun 04 13:46:28 2013 +0400
@@ -39,19 +39,19 @@
     /**
      * Operations per unit of time,
      * {@link org.openjdk.jmh.logic.results.OpsPerTimeUnit}. */
-    OpsPerTimeUnit("thrpt", "Throughput, ops/time"),
+    Throughput("thrpt", "Throughput, ops/time"),
 
     /**
      * Average time per operation
      * {@link org.openjdk.jmh.logic.results.AverageTimePerOp}.
      */
-    AverageTimePerOp("avgt", "Average time, time/op"),
+    AverageTime("avgt", "Average time, time/op"),
 
     /**
      * Time distribution, percentile estimation
      * {@link org.openjdk.jmh.logic.results.SampleTimePerOp}.
      */
-    SampleTimePerOp("sample", "Sampling time"),
+    SampleTime("sample", "Sampling time"),
 
     /**
      * Time the single execution
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Tue Jun 04 13:46:28 2013 +0400
@@ -217,7 +217,7 @@
         // enforce the default value
         for (MethodGroup group : result.values()) {
             if (group.getMode() == null) {
-                group.setMode(Mode.OpsPerTimeUnit);
+                group.setMode(Mode.Throughput);
             }
         }
 
@@ -250,11 +250,11 @@
 
     private String packageNameByType(Mode bt) {
         switch (bt) {
-            case OpsPerTimeUnit:
+            case Throughput:
                 return "throughput";
-            case AverageTimePerOp:
+            case AverageTime:
                 return "avgtime";
-            case SampleTimePerOp:
+            case SampleTime:
                 return "sampletime";
             case SingleShotTime:
                 return "oneshot";
@@ -509,13 +509,13 @@
         }
         final TimeUnit timeUnit = findTimeUnit(methodGroup);
         switch (benchmarkKind) {
-            case OpsPerTimeUnit:
+            case Throughput:
                 generateOpsPerTimeUnit(writer, benchmarkKind, methodGroup, getOperationsPerInvocation(methodGroup), timeUnit, states);
                 break;
-            case AverageTimePerOp:
+            case AverageTime:
                 generateAverageTime(writer, benchmarkKind, methodGroup, getOperationsPerInvocation(methodGroup), timeUnit, states);
                 break;
-            case SampleTimePerOp:
+            case SampleTime:
                 generateTimeDistribution(writer, benchmarkKind, methodGroup, timeUnit, states);
                 break;
             case SingleShotTime:
@@ -674,7 +674,7 @@
     private static String generateMBAnnotation(Mode kind) {
         StringBuilder sb = new StringBuilder();
         sb.append("@").append(MicroBenchmark.class.getSimpleName());
-        if (kind != Mode.OpsPerTimeUnit) {
+        if (kind != Mode.Throughput) {
             sb.append("(Mode.").append(kind).append(')');
         }
         return sb.toString();
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_02_BenchmarkModes.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_02_BenchmarkModes.java	Tue Jun 04 13:46:28 2013 +0400
@@ -58,7 +58,7 @@
 
     @OutputTimeUnit(TimeUnit.SECONDS)
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.OpsPerTimeUnit)
+    @BenchmarkMode(Mode.Throughput)
     public void measureThroughput() throws InterruptedException {
         TimeUnit.MILLISECONDS.sleep(100);
     }
@@ -71,7 +71,7 @@
 
     @OutputTimeUnit(TimeUnit.MICROSECONDS)
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.AverageTimePerOp)
+    @BenchmarkMode(Mode.AverageTime)
     public void measureAvgTime() throws InterruptedException {
         TimeUnit.MILLISECONDS.sleep(100);
     }
@@ -88,7 +88,7 @@
      */
     @OutputTimeUnit(TimeUnit.MICROSECONDS)
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.SampleTimePerOp)
+    @BenchmarkMode(Mode.SampleTime)
     public void measureSamples() throws InterruptedException {
         TimeUnit.MILLISECONDS.sleep(100);
     }
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_07_FixtureLevelInvocation.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_07_FixtureLevelInvocation.java	Tue Jun 04 13:46:28 2013 +0400
@@ -105,13 +105,13 @@
      */
 
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.AverageTimePerOp)
+    @BenchmarkMode(Mode.AverageTime)
     public double measureHot(NormalState e, final Scratch s) throws ExecutionException, InterruptedException {
         return e.service.submit(new Task(s)).get();
     }
 
     @GenerateMicroBenchmark
-    @BenchmarkMode(Mode.AverageTimePerOp)
+    @BenchmarkMode(Mode.AverageTime)
     public double measureCold(LaggingState e, final Scratch s) throws ExecutionException, InterruptedException {
         return e.service.submit(new Task(s)).get();
     }
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_08_DeadCode.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_08_DeadCode.java	Tue Jun 04 13:46:28 2013 +0400
@@ -34,7 +34,7 @@
 import java.util.concurrent.TimeUnit;
 
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_08_DeadCode {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_09_Blackholes.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_09_Blackholes.java	Tue Jun 04 13:46:28 2013 +0400
@@ -34,7 +34,7 @@
 
 import java.util.concurrent.TimeUnit;
 
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 @State(Scope.Thread)
 public class JMHSample_09_Blackholes {
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_10_ConstantFold.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_10_ConstantFold.java	Tue Jun 04 13:46:28 2013 +0400
@@ -34,7 +34,7 @@
 import java.util.concurrent.TimeUnit;
 
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_10_ConstantFold {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_11_Loops.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_11_Loops.java	Tue Jun 04 13:46:28 2013 +0400
@@ -35,7 +35,7 @@
 import java.util.concurrent.TimeUnit;
 
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_11_Loops {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_12_Forking.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_12_Forking.java	Tue Jun 04 13:46:28 2013 +0400
@@ -35,7 +35,7 @@
 import java.util.concurrent.TimeUnit;
 
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_12_Forking {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_13_RunToRun.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_13_RunToRun.java	Tue Jun 04 13:46:28 2013 +0400
@@ -36,7 +36,7 @@
 import java.util.concurrent.TimeUnit;
 
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.MILLISECONDS)
 public class JMHSample_13_RunToRun {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_15_Asymmetric.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_15_Asymmetric.java	Tue Jun 04 13:46:28 2013 +0400
@@ -38,7 +38,7 @@
 import java.util.concurrent.atomic.AtomicInteger;
 
 @State(Scope.Group)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_15_Asymmetric {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_16_CompilerControl.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_16_CompilerControl.java	Tue Jun 04 13:46:28 2013 +0400
@@ -35,7 +35,7 @@
 import java.util.concurrent.TimeUnit;
 
 @State(Scope.Thread)
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_16_CompilerControl {
 
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_21_ConsumeCPU.java	Tue Jun 04 13:44:21 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_21_ConsumeCPU.java	Tue Jun 04 13:46:28 2013 +0400
@@ -32,7 +32,7 @@
 
 import java.util.concurrent.TimeUnit;
 
-@BenchmarkMode(Mode.AverageTimePerOp)
+@BenchmarkMode(Mode.AverageTime)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class JMHSample_21_ConsumeCPU {