mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2026-08-08 20:18:11 -05:00
support maturity level on CLI and module loader
This commit is contained in:
@@ -17,6 +17,7 @@ import io.nosqlbench.engine.core.script.Scenario;
|
||||
import io.nosqlbench.engine.core.script.ScenariosExecutor;
|
||||
import io.nosqlbench.engine.core.script.ScriptParams;
|
||||
import io.nosqlbench.engine.docker.DockerMetricsManager;
|
||||
import io.nosqlbench.nb.annotations.Maturity;
|
||||
import io.nosqlbench.nb.api.annotations.Annotation;
|
||||
import io.nosqlbench.nb.api.annotations.Layer;
|
||||
import io.nosqlbench.nb.api.content.Content;
|
||||
@@ -56,10 +57,8 @@ public class NBCLI {
|
||||
|
||||
public NBCLI(String commandName) {
|
||||
this.commandName = commandName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
NBCLI cli = new NBCLI("eb");
|
||||
@@ -264,12 +263,12 @@ public class NBCLI {
|
||||
}
|
||||
|
||||
if (options.wantsInputTypes()) {
|
||||
InputType.FINDER.getAllSelectors().forEach(System.out::println);
|
||||
InputType.FINDER.getAllSelectors().forEach((k,v) -> System.out.println(k + " (" + v.name() + ")"));
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
if (options.wantsMarkerTypes()) {
|
||||
OutputType.FINDER.getAllSelectors().forEach(System.out::println);
|
||||
OutputType.FINDER.getAllSelectors().forEach((k,v) -> System.out.println(k + " (" + v.name() + ")"));
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -365,8 +364,8 @@ public class NBCLI {
|
||||
options.wantsCompileScript(),
|
||||
options.getReportSummaryTo(),
|
||||
String.join("\n", args),
|
||||
options.getLogsDirectory()
|
||||
);
|
||||
options.getLogsDirectory(),
|
||||
Maturity.Unspecified);
|
||||
|
||||
ScriptBuffer buffer = new BasicScriptBuffer()
|
||||
.add(options.getCommands()
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.nosqlbench.engine.cli;
|
||||
import io.nosqlbench.engine.api.metrics.IndicatorMode;
|
||||
import io.nosqlbench.engine.api.util.Unit;
|
||||
import io.nosqlbench.engine.core.script.Scenario;
|
||||
import io.nosqlbench.nb.annotations.Maturity;
|
||||
import io.nosqlbench.nb.api.NBEnvironment;
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
import io.nosqlbench.nb.api.logging.NBLogLevel;
|
||||
@@ -59,6 +60,8 @@ public class NBCLIOptions {
|
||||
private static final String SCRIPT_FILE = "--script-file";
|
||||
private static final String COPY = "--copy";
|
||||
private static final String SHOW_STACKTRACES = "--show-stacktraces";
|
||||
private static final String EXPERIMENTAL = "--experimental";
|
||||
private static final String MATURITY = "--maturity";
|
||||
|
||||
// Execution
|
||||
private static final String EXPORT_CYCLE_LOG = "--export-cycle-log";
|
||||
@@ -67,6 +70,7 @@ public class NBCLIOptions {
|
||||
|
||||
// Execution Options
|
||||
|
||||
|
||||
private static final String SESSION_NAME = "--session-name";
|
||||
private static final String LOGS_DIR = "--logs-dir";
|
||||
private static final String WORKSPACES_DIR = "--workspaces-dir";
|
||||
@@ -162,6 +166,7 @@ public class NBCLIOptions {
|
||||
private String dockerPromRetentionDays = "183d";
|
||||
private String reportSummaryTo = REPORT_SUMMARY_TO_DEFAULT;
|
||||
private boolean enableAnsi = System.getenv("TERM")!=null && !System.getenv("TERM").isEmpty();
|
||||
private Maturity minMaturity = Maturity.Unspecified;
|
||||
|
||||
public String getAnnotatorsConfig() {
|
||||
return annotatorsConfig;
|
||||
@@ -392,6 +397,15 @@ public class NBCLIOptions {
|
||||
arglist.removeFirst();
|
||||
showStackTraces = true;
|
||||
break;
|
||||
case EXPERIMENTAL:
|
||||
arglist.removeFirst();
|
||||
arglist.addFirst("experimental");
|
||||
arglist.addFirst("--maturity");
|
||||
break;
|
||||
case MATURITY:
|
||||
arglist.removeFirst();
|
||||
String maturity = readWordOrThrow(arglist,"maturity of components to allow");
|
||||
this.minMaturity = Maturity.valueOf(maturity.toLowerCase(Locale.ROOT));
|
||||
default:
|
||||
nonincludes.addLast(arglist.removeFirst());
|
||||
}
|
||||
@@ -626,6 +640,10 @@ public class NBCLIOptions {
|
||||
return configs;
|
||||
}
|
||||
|
||||
public Maturity allowMinMaturity() {
|
||||
return minMaturity;
|
||||
}
|
||||
|
||||
public List<Cmd> getCommands() {
|
||||
return cmdList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user