changeset 304:6fcaa4228b4f

Rename Recipe -> ActionPlan. Internal interface enhancements.
author shade
date Thu, 05 Dec 2013 11:37:00 +0400
parents 501b2f7a4ca2
children 578b0b6a25d9
files jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkClient.java jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java jmh-core/src/main/java/org/openjdk/jmh/link/frames/ActionPlanFrame.java jmh-core/src/main/java/org/openjdk/jmh/link/frames/InfraFrame.java jmh-core/src/main/java/org/openjdk/jmh/link/frames/RecipeFrame.java jmh-core/src/main/java/org/openjdk/jmh/runner/Action.java jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java jmh-core/src/main/java/org/openjdk/jmh/runner/ActionPlan.java jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java jmh-core/src/main/java/org/openjdk/jmh/runner/ForkedRunner.java jmh-core/src/main/java/org/openjdk/jmh/runner/Recipe.java jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/BenchmarkParams.java
diffstat 13 files changed, 290 insertions(+), 199 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkClient.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkClient.java	Thu Dec 05 11:37:00 2013 +0400
@@ -24,15 +24,15 @@
  */
 package org.openjdk.jmh.link;
 
+import org.openjdk.jmh.link.frames.ActionPlanFrame;
 import org.openjdk.jmh.link.frames.FinishingFrame;
 import org.openjdk.jmh.link.frames.InfraFrame;
 import org.openjdk.jmh.link.frames.OptionsFrame;
 import org.openjdk.jmh.link.frames.OutputFormatFrame;
-import org.openjdk.jmh.link.frames.RecipeFrame;
 import org.openjdk.jmh.link.frames.ResultsFrame;
 import org.openjdk.jmh.logic.results.BenchResult;
+import org.openjdk.jmh.runner.ActionPlan;
 import org.openjdk.jmh.runner.BenchmarkRecord;
-import org.openjdk.jmh.runner.Recipe;
 import org.openjdk.jmh.runner.options.Options;
 
 import java.io.IOException;
@@ -88,13 +88,13 @@
         oos.flush();
     }
 
-    public Recipe requestRecipe() throws IOException, ClassNotFoundException {
-        oos.writeObject(new InfraFrame(InfraFrame.Type.RECIPE_REQUEST));
+    public ActionPlan requestPlan() throws IOException, ClassNotFoundException {
+        oos.writeObject(new InfraFrame(InfraFrame.Type.ACTION_PLAN_REQUEST));
         oos.flush();
 
         Object reply = ois.readObject();
-        if (reply instanceof RecipeFrame) {
-            return ((RecipeFrame) reply).getRecipe();
+        if (reply instanceof ActionPlanFrame) {
+            return ((ActionPlanFrame) reply).getActionPlan();
         } else {
             throw new IllegalStateException("Got the erroneous reply: " + reply);
         }
--- a/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/link/BinaryLinkServer.java	Thu Dec 05 11:37:00 2013 +0400
@@ -24,15 +24,15 @@
  */
 package org.openjdk.jmh.link;
 
+import org.openjdk.jmh.link.frames.ActionPlanFrame;
 import org.openjdk.jmh.link.frames.FinishingFrame;
 import org.openjdk.jmh.link.frames.InfraFrame;
 import org.openjdk.jmh.link.frames.OptionsFrame;
 import org.openjdk.jmh.link.frames.OutputFormatFrame;
-import org.openjdk.jmh.link.frames.RecipeFrame;
 import org.openjdk.jmh.link.frames.ResultsFrame;
 import org.openjdk.jmh.logic.results.BenchResult;
 import org.openjdk.jmh.output.format.OutputFormat;
-import org.openjdk.jmh.runner.Recipe;
+import org.openjdk.jmh.runner.ActionPlan;
 import org.openjdk.jmh.runner.options.Options;
 
 import java.io.IOException;
@@ -69,7 +69,7 @@
     private final Acceptor acceptor;
     private final AtomicReference<Handler> handler;
     private final AtomicReference<BenchResult> result;
-    private final AtomicReference<Recipe> recipe;
+    private final AtomicReference<ActionPlan> plan;
 
     public BinaryLinkServer(Options opts, OutputFormat out) throws IOException {
         this.opts = opts;
@@ -96,7 +96,7 @@
 
         handler = new AtomicReference<Handler>();
         result = new AtomicReference<BenchResult>();
-        recipe = new AtomicReference<Recipe>();
+        plan = new AtomicReference<ActionPlan>();
     }
 
     public void terminate() {
@@ -137,8 +137,8 @@
         }
     }
 
-    public void setRecipe(Recipe recipe) {
-        this.recipe.set(recipe);
+    public void setPlan(ActionPlan actionPlan) {
+        this.plan.set(actionPlan);
     }
 
     private final class Acceptor extends Thread {
@@ -263,8 +263,8 @@
                     oos.writeObject(new OptionsFrame(opts));
                     oos.flush();
                     break;
-                case RECIPE_REQUEST:
-                    oos.writeObject(new RecipeFrame(recipe.get()));
+                case ACTION_PLAN_REQUEST:
+                    oos.writeObject(new ActionPlanFrame(plan.get()));
                     oos.flush();
                     break;
                 default:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/link/frames/ActionPlanFrame.java	Thu Dec 05 11:37:00 2013 +0400
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.link.frames;
+
+import org.openjdk.jmh.runner.ActionPlan;
+
+import java.io.Serializable;
+
+public class ActionPlanFrame implements Serializable {
+    private final ActionPlan actionPlan;
+
+    public ActionPlanFrame(ActionPlan actionPlan) {
+        this.actionPlan = actionPlan;
+    }
+
+    public ActionPlan getActionPlan() {
+        return actionPlan;
+    }
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/link/frames/InfraFrame.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/link/frames/InfraFrame.java	Thu Dec 05 11:37:00 2013 +0400
@@ -40,7 +40,7 @@
 
     public enum Type {
         OPTIONS_REQUEST,
-        RECIPE_REQUEST,
+        ACTION_PLAN_REQUEST,
     }
 
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/link/frames/RecipeFrame.java	Thu Dec 05 00:50:26 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.link.frames;
-
-import org.openjdk.jmh.runner.Recipe;
-
-import java.io.Serializable;
-
-public class RecipeFrame implements Serializable {
-    private final Recipe recipe;
-
-    public RecipeFrame(Recipe recipe) {
-        this.recipe = recipe;
-    }
-
-    public Recipe getRecipe() {
-        return recipe;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Action.java	Thu Dec 05 11:37:00 2013 +0400
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.runner;
+
+import java.io.Serializable;
+
+public class Action implements Serializable {
+    private final BenchmarkRecord benchmark;
+    private final ActionMode mode;
+
+    public Action(BenchmarkRecord benchmark, ActionMode mode) {
+        this.benchmark = benchmark;
+        this.mode = mode;
+    }
+
+    public BenchmarkRecord getBenchmark() {
+        return benchmark;
+    }
+
+    public ActionMode getMode() {
+        return mode;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/ActionMode.java	Thu Dec 05 11:37:00 2013 +0400
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.runner;
+
+public enum ActionMode {
+
+    /**
+     * No action.
+     */
+    UNDEF(false, false),
+
+    /**
+     * Do warmup only.
+     */
+    WARMUP(true, false),
+
+    /**
+     * Do measurement only.
+     */
+    MEASUREMENT(false, true),
+
+    /**
+     * Do both warmup and measurement
+     */
+    WARMUP_MEASUREMENT(true, true),
+    ;
+
+    private final boolean doWarmup;
+    private final boolean doMeasurement;
+
+    ActionMode(boolean doWarmup, boolean doMeasurement) {
+        this.doWarmup = doWarmup;
+        this.doMeasurement = doMeasurement;
+    }
+
+    public boolean doWarmup() {
+        return doWarmup;
+    }
+
+    public boolean doMeasurement() {
+        return doMeasurement;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/ActionPlan.java	Thu Dec 05 11:37:00 2013 +0400
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.runner;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class ActionPlan implements Serializable {
+
+    private final List<Action> actions;
+
+    public ActionPlan() {
+        actions = new ArrayList<Action>();
+    }
+
+    void addWarmup(BenchmarkRecord record) {
+        actions.add(new Action(record, ActionMode.WARMUP));
+    }
+
+    void addWarmup(Collection<BenchmarkRecord> rs) {
+        for (BenchmarkRecord b : rs) {
+            addWarmup(b);
+        }
+    }
+
+    void addMeasurement(BenchmarkRecord record) {
+        actions.add(new Action(record, ActionMode.MEASUREMENT));
+    }
+
+    void addMeasurement(Collection<BenchmarkRecord> rs) {
+        for (BenchmarkRecord b : rs) {
+            addMeasurement(b);
+        }
+    }
+
+    void addWarmupMeasurement(BenchmarkRecord record) {
+        actions.add(new Action(record, ActionMode.WARMUP_MEASUREMENT));
+    }
+
+    void addWarmupMeasurement(Collection<BenchmarkRecord> rs) {
+        for (BenchmarkRecord b : rs) {
+            addWarmupMeasurement(b);
+        }
+    }
+
+    public void mixIn(ActionPlan other) {
+        actions.addAll(other.actions);
+    }
+
+    public List<Action> getActions() {
+        return actions;
+    }
+
+    public List<Action> getMeasurementActions() {
+        List<Action> result = new ArrayList<Action>();
+        for (Action action : actions) {
+            switch (action.getMode()) {
+                case MEASUREMENT:
+                case WARMUP_MEASUREMENT:
+                    result.add(action);
+                    break;
+
+            }
+        }
+        return result;
+    }
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Thu Dec 05 11:37:00 2013 +0400
@@ -60,13 +60,13 @@
         this.out = handler;
     }
 
-    protected Multimap<BenchmarkRecord, BenchResult> runBenchmarks(boolean forked, Recipe recipe) {
+    protected Multimap<BenchmarkRecord, BenchResult> runBenchmarks(boolean forked, ActionPlan actionPlan) {
         Multimap<BenchmarkRecord, BenchResult> results = new TreeMultimap<BenchmarkRecord, BenchResult>();
 
-        for (Recipe.Action action : recipe.getActions()) {
+        for (Action action : actionPlan.getActions()) {
 
-            BenchmarkRecord benchmark = action.record;
-            Recipe.Mode mode = action.mode;
+            BenchmarkRecord benchmark = action.getBenchmark();
+            ActionMode mode = action.getMode();
 
             if (!forked) {
                 out.println("# Fork: N/A, test runs in the existing VM");
@@ -74,17 +74,13 @@
 
             switch (mode) {
                 case WARMUP: {
-                    runBenchmark(benchmark, true, false);
+                    runBenchmark(benchmark, mode);
                     out.println("");
                     break;
                 }
+                case WARMUP_MEASUREMENT:
                 case MEASUREMENT: {
-                    BenchResult r = runBenchmark(benchmark, false, true);
-                    results.put(benchmark, r);
-                    break;
-                }
-                case WARMUP_MEASUREMENT: {
-                    BenchResult r = runBenchmark(benchmark, true, true);
+                    BenchResult r = runBenchmark(benchmark, mode);
                     results.put(benchmark, r);
                     break;
                 }
@@ -96,13 +92,13 @@
         return results;
     }
 
-    BenchResult runBenchmark(BenchmarkRecord benchmark, boolean doWarmup, boolean doMeasurement) {
+    BenchResult runBenchmark(BenchmarkRecord benchmark, ActionMode mode) {
         MicroBenchmarkHandler handler = null;
         try {
             Class<?> clazz = ClassUtils.loadClass(benchmark.generatedClass());
             Method method = MicroBenchmarkHandlers.findBenchmarkMethod(clazz, benchmark.generatedMethod());
 
-            BenchmarkParams executionParams = new BenchmarkParams(options, benchmark, doWarmup, doMeasurement);
+            BenchmarkParams executionParams = new BenchmarkParams(options, benchmark, mode);
             handler = MicroBenchmarkHandlers.getInstance(out, benchmark, clazz, method, executionParams, options);
 
             return runBenchmark(executionParams, handler);
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/ForkedRunner.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/ForkedRunner.java	Thu Dec 05 11:37:00 2013 +0400
@@ -47,9 +47,9 @@
     }
 
     public void run() throws IOException, ClassNotFoundException {
-        Recipe recipe = link.requestRecipe();
+        ActionPlan actionPlan = link.requestPlan();
 
-        Multimap<BenchmarkRecord,BenchResult> res = runBenchmarks(true, recipe);
+        Multimap<BenchmarkRecord,BenchResult> res = runBenchmarks(true, actionPlan);
         for (BenchmarkRecord br : res.keys()) {
             for (BenchResult r : res.get(br)) {
                 link.pushResults(br, r);
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Recipe.java	Thu Dec 05 00:50:26 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.runner;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class Recipe implements Serializable {
-
-    private final List<Action> actions;
-
-    public Recipe() {
-        actions = new ArrayList<Action>();
-    }
-
-    void addWarmup(BenchmarkRecord record) {
-        actions.add(new Action(record, Mode.WARMUP));
-    }
-
-    void addWarmup(Collection<BenchmarkRecord> rs) {
-        for (BenchmarkRecord b : rs) {
-            addWarmup(b);
-        }
-    }
-
-    void addMeasurement(BenchmarkRecord record) {
-        actions.add(new Action(record, Mode.MEASUREMENT));
-    }
-
-    void addMeasurement(Collection<BenchmarkRecord> rs) {
-        for (BenchmarkRecord b : rs) {
-            addMeasurement(b);
-        }
-    }
-
-    void addWarmupMeasurement(BenchmarkRecord record) {
-        actions.add(new Action(record, Mode.WARMUP_MEASUREMENT));
-    }
-
-    void addWarmupMeasurement(Collection<BenchmarkRecord> rs) {
-        for (BenchmarkRecord b : rs) {
-            addWarmupMeasurement(b);
-        }
-    }
-
-    public void mixIn(Recipe other) {
-        actions.addAll(other.actions);
-    }
-
-    public List<Action> getActions() {
-        return actions;
-    }
-
-    public List<Action> getMeasurementActions() {
-        List<Action> result = new ArrayList<Action>();
-        for (Action action : actions) {
-            switch (action.mode) {
-                case MEASUREMENT:
-                case WARMUP_MEASUREMENT:
-                    result.add(action);
-                    break;
-
-            }
-        }
-        return result;
-    }
-
-    public static class Action implements Serializable {
-        public final BenchmarkRecord record;
-        public final Mode mode;
-
-        public Action(BenchmarkRecord record, Mode mode) {
-            this.record = record;
-            this.mode = mode;
-        }
-    }
-
-    public static enum Mode {
-        WARMUP,
-        MEASUREMENT,
-        WARMUP_MEASUREMENT,
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Thu Dec 05 11:37:00 2013 +0400
@@ -203,8 +203,8 @@
         return results;
     }
 
-    private Recipe getEmbeddedRecipe(Set<BenchmarkRecord> benchmarks) {
-        Recipe r = new Recipe();
+    private ActionPlan getEmbeddedActionPlan(Set<BenchmarkRecord> benchmarks) {
+        ActionPlan r = new ActionPlan();
 
         List<String> warmupMicrosRegexp = options.getWarmupIncludes();
         if (warmupMicrosRegexp != null && !warmupMicrosRegexp.isEmpty()) {
@@ -215,7 +215,7 @@
         }
 
         for (BenchmarkRecord br : benchmarks) {
-            BenchmarkParams params = new BenchmarkParams(options, br, true, true);
+            BenchmarkParams params = new BenchmarkParams(options, br, ActionMode.UNDEF);
             if (params.getForks() <= 0) {
                 if (options.getWarmupMode().isIndi()) {
                     r.addWarmupMeasurement(br);
@@ -228,8 +228,8 @@
         return r;
     }
 
-    private Set<Recipe> getForkedRecipes(Set<BenchmarkRecord> benchmarks) {
-        Recipe base = new Recipe();
+    private Set<ActionPlan> getForkedActionPlans(Set<BenchmarkRecord> benchmarks) {
+        ActionPlan base = new ActionPlan();
 
         List<String> warmupMicrosRegexp = options.getWarmupIncludes();
         if (warmupMicrosRegexp != null && !warmupMicrosRegexp.isEmpty()) {
@@ -239,11 +239,11 @@
             base.addWarmup(benchmarks);
         }
 
-        Set<Recipe> result = new HashSet<Recipe>();
+        Set<ActionPlan> result = new HashSet<ActionPlan>();
         for (BenchmarkRecord br : benchmarks) {
-            BenchmarkParams params = new BenchmarkParams(options, br, true, true);
+            BenchmarkParams params = new BenchmarkParams(options, br, ActionMode.UNDEF);
             if (params.getForks() > 0) {
-                Recipe r = new Recipe();
+                ActionPlan r = new ActionPlan();
                 r.mixIn(base);
                 if (options.getWarmupMode().isIndi()) {
                     r.addWarmupMeasurement(br);
@@ -263,14 +263,14 @@
         Multimap<BenchmarkRecord, BenchResult> results = new TreeMultimap<BenchmarkRecord, BenchResult>();
 
         {
-            Recipe recipe = getEmbeddedRecipe(benchmarks);
-            Multimap<BenchmarkRecord, BenchResult> res = runBenchmarks(false, recipe);
+            ActionPlan actionPlan = getEmbeddedActionPlan(benchmarks);
+            Multimap<BenchmarkRecord, BenchResult> res = runBenchmarks(false, actionPlan);
             for (BenchmarkRecord br : res.keys()) {
                 results.putAll(br, res.get(br));
             }
         }
 
-        for (Recipe r : getForkedRecipes(benchmarks)) {
+        for (ActionPlan r : getForkedActionPlans(benchmarks)) {
             Multimap<BenchmarkRecord, BenchResult> res = runSeparate(r);
             for (BenchmarkRecord br : res.keys()) {
                 results.putAll(br, res.get(br));
@@ -291,20 +291,20 @@
         return result;
     }
 
-    private Multimap<BenchmarkRecord, BenchResult> runSeparate(Recipe recipe) {
+    private Multimap<BenchmarkRecord, BenchResult> runSeparate(ActionPlan actionPlan) {
         Multimap<BenchmarkRecord, BenchResult> results = new HashMultimap<BenchmarkRecord, BenchResult>();
 
-        if (recipe.getMeasurementActions().size() != 1) {
-            throw new IllegalStateException("Expect only single benchmark in the recipe, but was " + recipe.getMeasurementActions().size());
+        if (actionPlan.getMeasurementActions().size() != 1) {
+            throw new IllegalStateException("Expect only single benchmark in the action plan, but was " + actionPlan.getMeasurementActions().size());
         }
 
         BinaryLinkServer server = null;
         try {
             server = new BinaryLinkServer(options, out);
 
-            server.setRecipe(recipe);
+            server.setPlan(actionPlan);
 
-            BenchmarkRecord benchmark = recipe.getMeasurementActions().get(0).record;
+            BenchmarkRecord benchmark = actionPlan.getMeasurementActions().get(0).getBenchmark();
 
                 // Running microbenchmark in separate JVM requires to read some options from annotations.
                 final Method benchmarkMethod = MicroBenchmarkHandlers.findBenchmarkMethod(benchmark);
@@ -327,7 +327,7 @@
 
                 String[] commandString = getSeparateExecutionCommand(annJvmArgs, annJvmArgsPrepend, annJvmArgsAppend, server.getHost(), server.getPort());
 
-                BenchmarkParams params = new BenchmarkParams(options, benchmark, true, true);
+                BenchmarkParams params = new BenchmarkParams(options, benchmark, ActionMode.UNDEF);
 
                 int forkCount = params.getForks();
                 int warmupForkCount = params.getWarmupForks();
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/BenchmarkParams.java	Thu Dec 05 00:50:26 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/BenchmarkParams.java	Thu Dec 05 11:37:00 2013 +0400
@@ -30,6 +30,7 @@
 import org.openjdk.jmh.annotations.Mode;
 import org.openjdk.jmh.annotations.Threads;
 import org.openjdk.jmh.annotations.Warmup;
+import org.openjdk.jmh.runner.ActionMode;
 import org.openjdk.jmh.runner.BenchmarkRecord;
 import org.openjdk.jmh.runner.MicroBenchmarkHandlers;
 import org.openjdk.jmh.runner.options.Options;
@@ -92,7 +93,7 @@
         this.measurement = new IterationParams(this, measureIters, measureTime);
     }
 
-    public BenchmarkParams(Options options, BenchmarkRecord benchmark, boolean doWarmup, boolean doMeasurement) {
+    public BenchmarkParams(Options options, BenchmarkRecord benchmark, ActionMode mode) {
         Class<?> clazz = ClassUtils.loadClass(benchmark.generatedClass());
         Method method = MicroBenchmarkHandlers.findBenchmarkMethod(clazz, benchmark.generatedMethod());
 
@@ -106,11 +107,11 @@
 
         this.synchIterations = getBoolean(options.shouldSyncIterations(), Defaults.SHOULD_SYNCH_ITERATIONS);
 
-        this.measurement = doMeasurement ?
+        this.measurement = mode.doMeasurement() ?
                 getMeasurement(options, benchmark, method) :
                 new IterationParams(this, 0, TimeValue.NONE);
 
-        this.warmup = doWarmup ?
+        this.warmup = mode.doWarmup() ?
                 getWarmup(options, benchmark, method) :
                 new IterationParams(this, 0, TimeValue.NONE);