diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java index 77b0d0e82..2b062ebc9 100644 --- a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java +++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLI.java @@ -5,8 +5,6 @@ import io.nosqlbench.engine.api.activityapi.cyclelog.outputs.cyclelog.CycleLogDu import io.nosqlbench.engine.api.activityapi.cyclelog.outputs.cyclelog.CycleLogImporterUtility; import io.nosqlbench.engine.api.activityapi.input.InputType; import io.nosqlbench.engine.api.activityapi.output.OutputType; -import io.nosqlbench.engine.api.scenarios.NBCLIScenarioParser; -import io.nosqlbench.engine.api.scenarios.WorkloadDesc; import io.nosqlbench.nb.api.content.Content; import io.nosqlbench.nb.api.content.NBIO; import io.nosqlbench.nb.api.errors.BasicError; @@ -96,12 +94,12 @@ public class NBCLI { } if (options.wantsWorkloadsList()) { - printWorkloads(false, options.wantsIncludes()); + NBCLIScenarios.printWorkloads(false, options.wantsIncludes()); System.exit(0); } if (options.wantsScenariosList()) { - printWorkloads(true, options.wantsIncludes()); + NBCLIScenarios.printWorkloads(true, options.wantsIncludes()); System.exit(0); } @@ -282,49 +280,6 @@ public class NBCLI { } } - public void printWorkloads(boolean includeScenarios, - String... includes) { - List workloads = - NBCLIScenarioParser.getWorkloadsWithScenarioScripts(includes); - - for (WorkloadDesc workload : workloads) { - System.out.println(workload.getYamlPath()); - - if (includeScenarios) { - System.out.println(" # scenarios:"); - - List scenarioList = workload.getScenarioNames(); - String workloadName = workload.getWorkloadName(); - - for (String scenario : scenarioList) { - System.out.println(" nb " + workloadName + " " + scenario); - } - - Map templates = workload.getTemplates(); - if (templates.size() > 0) { - System.out.println(" # defaults"); - for (Map.Entry templateEntry : templates.entrySet()) { - System.out.println(" " + templateEntry.getKey() + " = " + templateEntry.getValue()); - } - } - System.out.println("\n"); - } - - } - - if (!includeScenarios) { - System.out.println("\n# To see scenarios scenarios, use --list-scenarios"); - } - - System.out.println( - "\n" + - "# To include examples, add --include=examples\n" + - "# To copy any of these to your local directory, use\n" + - "# --include=examples --copy=examplename\n" - ); - - } - private String loadHelpFile(String filename) { ClassLoader cl = getClass().getClassLoader(); InputStream resourceAsStream = cl.getResourceAsStream(filename); diff --git a/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIScenarios.java b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIScenarios.java new file mode 100644 index 000000000..207df8f5e --- /dev/null +++ b/engine-cli/src/main/java/io/nosqlbench/engine/cli/NBCLIScenarios.java @@ -0,0 +1,56 @@ +package io.nosqlbench.engine.cli; + +import io.nosqlbench.engine.api.scenarios.NBCLIScenarioParser; +import io.nosqlbench.engine.api.scenarios.WorkloadDesc; + +import java.util.List; +import java.util.Map; + +public class NBCLIScenarios { + public static void printWorkloads(boolean includeScenarios, + String... includes) { + List workloads = + NBCLIScenarioParser.getWorkloadsWithScenarioScripts(includes); + + for (WorkloadDesc workload : workloads) { + if (includeScenarios) { + System.out.print("# workload in "); + } + + System.out.println(workload.getYamlPath()); + + if (includeScenarios) { + System.out.println(" # scenarios:"); + + List scenarioList = workload.getScenarioNames(); + String workloadName = workload.getWorkloadName(); + + for (String scenario : scenarioList) { + System.out.println(" nb " + workloadName + " " + scenario); + } + + Map templates = workload.getTemplates(); + if (templates.size() > 0) { + System.out.println(" # defaults"); + for (Map.Entry templateEntry : templates.entrySet()) { + System.out.println(" " + templateEntry.getKey() + " = " + templateEntry.getValue()); + } + } + System.out.println("\n"); + } + + } + + if (!includeScenarios) { + System.out.println("\n# To see scenarios scenarios, use --list-scenarios"); + } + + System.out.println( + "\n" + + "# To include examples, add --include=examples\n" + + "# To copy any of these to your local directory, use\n" + + "# --include=examples --copy=examplename\n" + ); + + } +}