fixes for passing basic tests

This commit is contained in:
Jonathan Shook
2023-09-29 19:31:42 -05:00
parent 7e2ddc745a
commit 7f960778b4
10 changed files with 63 additions and 77 deletions

View File

@@ -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;
}
}