enable label filtering and validation

This commit is contained in:
Jonathan Shook
2023-09-09 20:31:15 -05:00
parent 31a75cd2e9
commit 186e87ac1b
19 changed files with 504 additions and 34 deletions

View File

@@ -400,7 +400,7 @@ public class NBCLI implements Function<String[], Integer>, NBLabeledElement {
}
NBCLI.logger.debug("initializing annotators with config:'{}'", annotatorsConfig);
Annotators.init(annotatorsConfig);
Annotators.init(annotatorsConfig, options.getAnnotateLabelSpec());
Annotators.recordAnnotation(
Annotation.newBuilder()
.element(this)

View File

@@ -52,6 +52,8 @@ public class NBCLIOptions {
private static final Map<String, String> DEFAULT_LABELS = Map.of("appname", "nosqlbench");
private static final String METRICS_PREFIX = "--metrics-prefix";
private static final String ANNOTATE_EVENTS = "--annotate";
private static final String ANNOTATE_LABELSPEC = "--annotate-labelspec";
private static final String ANNOTATORS_CONFIG = "--annotators";
private static final String PROMPUSH_CONFIG = "--prompush";
@@ -200,6 +202,7 @@ public class NBCLIOptions {
private boolean wantsListApps;
private boolean dedicatedVerificationLogger;
private boolean wantsConsoleMetrics =true;
private String annotateLabelSpec="";
public boolean wantsLoggedMetrics() { return this.wantsConsoleMetrics; }
public boolean isWantsListApps() {
@@ -258,6 +261,10 @@ public class NBCLIOptions {
this.dedicatedVerificationLogger = true;
}
public String getAnnotateLabelSpec() {
return annotateLabelSpec;
}
public enum Mode {
ParseGlobalsOnly,
ParseAllOptions
@@ -497,6 +504,9 @@ public class NBCLIOptions {
arglist.removeFirst();
this.wantsConsoleMetrics =false;
break;
case ANNOTATE_LABELSPEC:
arglist.removeFirst();
this.annotateLabelSpec = this.readWordOrThrow(arglist, "labels validator specification");
default:
nonincludes.addLast(arglist.removeFirst());
}