changeset 340:f37f3c5f03ca

Capitalize VerboseMode.
author shade
date Mon, 13 Jan 2014 15:40:17 +0400
parents 6c1661cc20e8
children 310927fb382e
files jmh-core-benchmarks/src/main/java/org/openjdk/jmh/MainValidation.java jmh-core-it/src/test/java/org/openjdk/jmh/it/parameters/Parameters.java jmh-core/src/main/java/org/openjdk/jmh/output/format/AbstractOutputFormat.java jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormatFactory.java jmh-core/src/main/java/org/openjdk/jmh/profile/ProfilerType.java jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/VerboseMode.java jmh-core/src/test/java/org/openjdk/jmh/runner/TestMicroBenchmarkList.java
diffstat 10 files changed, 30 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/MainValidation.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/MainValidation.java	Mon Jan 13 15:40:17 2014 +0400
@@ -62,7 +62,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(EmptyBench.class.getCanonicalName() + ".*")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -76,7 +76,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelTrialBench.class.getCanonicalName() + ".*benchmark_setup")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -90,7 +90,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelTrialBench.class.getCanonicalName() + ".*benchmark_teardown")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -104,7 +104,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelIterationBench.class.getCanonicalName() + ".*benchmark_setup")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -118,7 +118,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelIterationBench.class.getCanonicalName() + ".*benchmark_teardown")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -132,7 +132,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelInvocationBench.class.getCanonicalName() + ".*benchmark_setup")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -146,7 +146,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelInvocationBench.class.getCanonicalName() + ".*benchmark_teardown")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -172,7 +172,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(NanoTimerBench.class.getCanonicalName() + ".*latency")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -189,7 +189,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(NanoTimerBench.class.getCanonicalName() + ".*granularity")
-                    .verbosity(VerboseMode.Silent)
+                    .verbosity(VerboseMode.SILENT)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/parameters/Parameters.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/parameters/Parameters.java	Mon Jan 13 15:40:17 2014 +0400
@@ -37,7 +37,7 @@
 
     public static BenchmarkRecord get(Class<?> klass) {
         MicroBenchmarkList list = MicroBenchmarkList.fromFile("target/test-classes/META-INF/MicroBenchmarks");
-        Set<BenchmarkRecord> set = list.find(OutputFormatFactory.createFormatInstance(System.out, VerboseMode.Extra), ".*" + klass.getName().replaceAll("\\$",".") + ".*", Collections.<String>emptyList());
+        Set<BenchmarkRecord> set = list.find(OutputFormatFactory.createFormatInstance(System.out, VerboseMode.EXTRA), ".*" + klass.getName().replaceAll("\\$",".") + ".*", Collections.<String>emptyList());
         Assert.assertEquals("The single benchmark exists", 1, set.size());
         return set.iterator().next();
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/AbstractOutputFormat.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/AbstractOutputFormat.java	Mon Jan 13 15:40:17 2014 +0400
@@ -55,7 +55,7 @@
 
     @Override
     public void verbosePrintln(String s) {
-        if (verbose == VerboseMode.Extra) {
+        if (verbose == VerboseMode.EXTRA) {
             out.println(s);
         }
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormatFactory.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormatFactory.java	Mon Jan 13 15:40:17 2014 +0400
@@ -25,9 +25,6 @@
 package org.openjdk.jmh.output.format;
 
 import org.openjdk.jmh.link.BinaryLinkClient;
-import org.openjdk.jmh.output.format.OutputFormat;
-import org.openjdk.jmh.output.format.SilentFormat;
-import org.openjdk.jmh.output.format.TextReportFormat;
 import org.openjdk.jmh.runner.options.VerboseMode;
 
 import java.io.PrintStream;
@@ -43,10 +40,10 @@
      */
     public static OutputFormat createFormatInstance(PrintStream out, VerboseMode mode) {
         switch (mode) {
-            case Silent:
+            case SILENT:
                 return new SilentFormat(out, mode);
-            case Normal:
-            case Extra:
+            case NORMAL:
+            case EXTRA:
                 return new TextReportFormat(out, mode);
             default:
                 throw new IllegalArgumentException("Mode " + mode + " not found!");
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/ProfilerType.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/ProfilerType.java	Mon Jan 13 15:40:17 2014 +0400
@@ -31,7 +31,7 @@
     GC {
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new GCProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new GCProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -57,7 +57,7 @@
     COMP {
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new CompilerProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new CompilerProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -83,7 +83,7 @@
     CL {
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new ClassloaderProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new ClassloaderProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -119,7 +119,7 @@
 
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new HotspotRuntimeProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new HotspotRuntimeProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -135,7 +135,7 @@
     HS_CL {
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new HotspotClassloadingProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new HotspotClassloadingProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -171,7 +171,7 @@
 
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new HotspotCompilationProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new HotspotCompilationProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -197,7 +197,7 @@
 
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new HotspotMemoryProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new HotspotMemoryProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
@@ -223,7 +223,7 @@
 
         @Override
         public Profiler createInstance(VerboseMode mode) {
-            return new HotspotThreadProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
+            return new HotspotThreadProfiler(label(), mode.equalsOrHigherThan(VerboseMode.EXTRA));
         }
 
         @Override
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Mon Jan 13 15:40:17 2014 +0400
@@ -25,7 +25,6 @@
 package org.openjdk.jmh.runner;
 
 import org.openjdk.jmh.ForkedMain;
-import org.openjdk.jmh.annotations.Fork;
 import org.openjdk.jmh.annotations.Mode;
 import org.openjdk.jmh.link.BinaryLinkServer;
 import org.openjdk.jmh.logic.results.BenchResult;
@@ -37,7 +36,6 @@
 import org.openjdk.jmh.runner.options.Options;
 import org.openjdk.jmh.runner.options.VerboseMode;
 import org.openjdk.jmh.runner.parameters.BenchmarkParams;
-import org.openjdk.jmh.util.AnnotationUtils;
 import org.openjdk.jmh.util.InputStreamDrainer;
 import org.openjdk.jmh.util.internal.HashMultimap;
 import org.openjdk.jmh.util.internal.Multimap;
@@ -51,7 +49,6 @@
 import java.io.PrintStream;
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -155,8 +152,8 @@
         if (benchmarks.isEmpty()) {
             out.println("No matching benchmarks. Miss-spelled regexp?");
 
-            if (options.verbosity() != VerboseMode.Extra) {
-                out.println("Use " + VerboseMode.Extra + " verbose mode to debug the pattern matching.");
+            if (options.verbosity() != VerboseMode.EXTRA) {
+                out.println("Use " + VerboseMode.EXTRA + " verbose mode to debug the pattern matching.");
             } else {
                 list();
             }
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Mon Jan 13 15:40:17 2014 +0400
@@ -104,7 +104,7 @@
     protected boolean gcEachIteration = false;
 
     @Option(name = "-v", aliases = {"--verbosity"}, metaVar = "LEVEL", usage = "Verbosity mode: (silent, normal, extra)")
-    protected VerboseMode verbose = VerboseMode.Normal;
+    protected VerboseMode verbose = VerboseMode.NORMAL;
 
     @Option(name = "-foe", usage = "Fail the harness on benchmark erro?", handler = BooleanOptionHandler.class)
     protected boolean failOnError = false;
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java	Mon Jan 13 15:40:17 2014 +0400
@@ -165,7 +165,7 @@
 
     // ---------------------------------------------------------------------------
 
-    private VerboseMode verbosity = VerboseMode.Normal;
+    private VerboseMode verbosity = VerboseMode.NORMAL;
 
     @Override
     public ChainedOptionsBuilder verbosity(VerboseMode mode) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/VerboseMode.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/VerboseMode.java	Mon Jan 13 15:40:17 2014 +0400
@@ -29,17 +29,17 @@
     /**
      * Be completely silent.
      */
-    Silent(0),
+    SILENT(0),
 
     /**
      * Output normally.
      */
-    Normal(1),
+    NORMAL(1),
 
     /**
      * Output extra info.
      */
-    Extra(2),
+    EXTRA(2),
 
     ;
 
--- a/jmh-core/src/test/java/org/openjdk/jmh/runner/TestMicroBenchmarkList.java	Sat Jan 11 02:11:04 2014 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/runner/TestMicroBenchmarkList.java	Mon Jan 13 15:40:17 2014 +0400
@@ -55,7 +55,7 @@
     public static void setUpClass() throws Exception {
         list = MicroBenchmarkList.fromResource("/org/openjdk/jmh/runner/MicroBenchmarks");
         excludes = new ArrayList<String>();
-        out = OutputFormatFactory.createFormatInstance(System.out, VerboseMode.Normal);
+        out = OutputFormatFactory.createFormatInstance(System.out, VerboseMode.NORMAL);
     }
 
     @Test