mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fixes for passing basic tests
This commit is contained in:
@@ -22,6 +22,7 @@ import io.nosqlbench.adapters.api.activityconfig.rawyaml.RawOpsLoader;
|
||||
import io.nosqlbench.api.annotations.Annotation;
|
||||
import io.nosqlbench.api.annotations.Layer;
|
||||
import io.nosqlbench.api.apps.BundledApp;
|
||||
import io.nosqlbench.components.NBBaseComponent;
|
||||
import io.nosqlbench.components.NBComponent;
|
||||
import io.nosqlbench.api.content.Content;
|
||||
import io.nosqlbench.api.content.NBIO;
|
||||
@@ -73,7 +74,7 @@ import java.util.ServiceLoader.Provider;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class NBCLI implements Function<String[], Integer>, NBComponent {
|
||||
public class NBCLI extends NBBaseComponent implements Function<String[], Integer> {
|
||||
|
||||
private static Logger logger;
|
||||
private static final LoggerConfig loggerConfig;
|
||||
@@ -92,10 +93,12 @@ public class NBCLI implements Function<String[], Integer>, NBComponent {
|
||||
private String sessionName;
|
||||
private String sessionCode;
|
||||
private long sessionTime;
|
||||
private NBLabels extraLabels = NBLabels.forKV();
|
||||
|
||||
private ClientSystemMetricChecker clientMetricChecker;
|
||||
|
||||
public NBCLI(final String commandName) {
|
||||
super(null, NBLabels.forKV("appname","nosqlbench"));
|
||||
this.commandName = commandName;
|
||||
}
|
||||
|
||||
@@ -163,6 +166,7 @@ public class NBCLI implements Function<String[], Integer>, NBComponent {
|
||||
NBCLI.loggerConfig.setConsoleLevel(NBLogLevel.ERROR);
|
||||
this.sessionTime = System.currentTimeMillis();
|
||||
final NBCLIOptions globalOptions = new NBCLIOptions(args, Mode.ParseGlobalsOnly);
|
||||
this.extraLabels=globalOptions.getLabelMap();
|
||||
|
||||
this.sessionCode = SystemId.genSessionCode(sessionTime);
|
||||
this.sessionName = SessionNamer.format(globalOptions.getSessionName(), sessionTime).replaceAll("SESSIONCODE", sessionCode);
|
||||
@@ -362,14 +366,6 @@ public class NBCLI implements Function<String[], Integer>, NBComponent {
|
||||
return NBCLI.EXIT_OK;
|
||||
}
|
||||
|
||||
// disabled for now
|
||||
// if (null != options.wantsMetricsForActivity()) {
|
||||
// final String metricsHelp = this.getMetricsHelpFor(options.wantsMetricsForActivity());
|
||||
// System.out.println("Available metric names for activity:" + options.wantsMetricsForActivity() + ':');
|
||||
// System.out.println(metricsHelp);
|
||||
// return NBCLI.EXIT_OK;
|
||||
// }
|
||||
|
||||
NBCLI.logger.debug("initializing annotators with config:'{}'", annotatorsConfig);
|
||||
Annotators.init(annotatorsConfig, options.getAnnotateLabelSpec());
|
||||
Annotators.recordAnnotation(
|
||||
@@ -599,11 +595,7 @@ public class NBCLI implements Function<String[], Integer>, NBComponent {
|
||||
|
||||
@Override
|
||||
public NBLabels getLabels() {
|
||||
return labels;
|
||||
return (extraLabels==null) ? super.getLabels() : super.getLabels().and(extraLabels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBComponent getParent() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user