changeset 141:9e8f44e958d3

Fold MicrobenchmarkList into Runner internal.
author shade
date Fri, 23 Aug 2013 14:34:33 +0400
parents 18ce82926141
children 197a3dcf3c1f
files jmh-core/src/main/java/org/openjdk/jmh/Main.java jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/Main.java	Fri Aug 23 13:53:18 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/Main.java	Fri Aug 23 14:34:33 2013 +0400
@@ -95,7 +95,7 @@
             }
 
             Runner runner = new Runner(cmdOptions);
-            runner.run(MicroBenchmarkList.defaultList());
+            runner.run();
         } catch (CmdLineException ex) {
             cmdOptions.printUsage(ex.getMessage());
         } catch (RunnerException e) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Fri Aug 23 13:53:18 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Fri Aug 23 14:34:33 2013 +0400
@@ -26,6 +26,7 @@
 
 import org.openjdk.jmh.annotations.Fork;
 import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.logic.results.internal.RunResult;
 import org.openjdk.jmh.output.OutputFormatFactory;
 import org.openjdk.jmh.output.format.OutputFormat;
 import org.openjdk.jmh.output.format.internal.BinaryOutputFormatReader;
@@ -63,8 +64,11 @@
     /** Class holding all our runtime options/arguments */
     private final HarnessOptions options;
 
+    private final MicroBenchmarkList list;
+
     public Runner(HarnessOptions options) {
         super(options, createOutputFormat(options));
+        this.list = MicroBenchmarkList.defaultList();
         this.options = options;
     }
 
@@ -88,7 +92,7 @@
     }
 
     /** Main entry point */
-    public void run(MicroBenchmarkList list) throws RunnerException {
+    public void run() throws RunnerException {
         Set<BenchmarkRecord> benchmarks = list.find(out, options.getRegexps(), options.getExcludes());
 
         if (benchmarks.isEmpty()) {
@@ -140,7 +144,7 @@
         if (!options.shouldList()) {
             if ((!options.getWarmupMicros().isEmpty()) ||
                     (options.getWarmupMode() == HarnessOptions.WarmupMode.BEFOREANY)) {
-                runBulkWarmupBenchmarks(benchmarks, list);
+                runBulkWarmupBenchmarks(benchmarks);
             } else {
                 runBenchmarks(benchmarks);
             }
@@ -154,7 +158,7 @@
      * Run specified warmup microbenchmarks prior to running any requested mircobenchmarks.
      * TODO: Currently valid only for non-external JVM runs
      */
-    private void runBulkWarmupBenchmarks(Set<BenchmarkRecord> benchmarks, MicroBenchmarkList list) {
+    private void runBulkWarmupBenchmarks(Set<BenchmarkRecord> benchmarks) {
         out.startRun();
 
         // list of micros executed before iteration