mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
more metrics sanitization
This commit is contained in:
@@ -180,7 +180,7 @@ public abstract class BaseOpDispenser<T extends Op, S> implements OpDispenser<T>
|
||||
final int hdrDigits = pop.getStaticConfigOr("hdr_digits", 4).intValue();
|
||||
successTimer = ActivityMetrics.timer(pop, "success", hdrDigits);
|
||||
errorTimer = ActivityMetrics.timer(pop, "error", hdrDigits);
|
||||
resultSizeHistogram = ActivityMetrics.histogram(pop, "resultset-size", hdrDigits);
|
||||
resultSizeHistogram = ActivityMetrics.histogram(pop, "resultset_size", hdrDigits);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ExceptionHistoMetrics {
|
||||
public ExceptionHistoMetrics(final NBLabeledElement parentLabels, final ActivityDef activityDef) {
|
||||
this.parentLabels = parentLabels;
|
||||
this.activityDef = activityDef;
|
||||
this.allerrors = ActivityMetrics.histogram(parentLabels, "errorhistos.ALL", activityDef.getParams().getOptionalInteger("hdr_digits").orElse(4));
|
||||
this.allerrors = ActivityMetrics.histogram(parentLabels, "errorhistos_ALL", activityDef.getParams().getOptionalInteger("hdr_digits").orElse(4));
|
||||
}
|
||||
|
||||
public void update(final String name, final long magnitude) {
|
||||
@@ -47,7 +47,7 @@ public class ExceptionHistoMetrics {
|
||||
if (null == h) synchronized (this.histos) {
|
||||
h = this.histos.computeIfAbsent(
|
||||
name,
|
||||
k -> ActivityMetrics.histogram(this.parentLabels, "errorhistos." + name, this.activityDef.getParams().getOptionalInteger("hdr_digits").orElse(4))
|
||||
errName -> ActivityMetrics.histogram(this.parentLabels, "errorhistos_"+errName, this.activityDef.getParams().getOptionalInteger("hdr_digits").orElse(4))
|
||||
);
|
||||
}
|
||||
h.update(magnitude);
|
||||
|
||||
@@ -207,7 +207,7 @@ public class NBCLIScenarioParser {
|
||||
alias = alias.replaceAll("STEP", sanitize(stepName));
|
||||
alias = (alias.startsWith("alias=") ? alias : "alias=" + alias);
|
||||
buildingCmd.put("alias", alias);
|
||||
buildingCmd.put("labels","labels=workload:"+sanitize(workloadToken));
|
||||
buildingCmd.put("labels","labels=workload:$"+sanitize(workloadToken));
|
||||
|
||||
logger.debug(() -> "rebuilt command: " + String.join(" ", buildingCmd.values()));
|
||||
buildCmdBuffer.addAll(buildingCmd.values());
|
||||
@@ -221,11 +221,12 @@ public class NBCLIScenarioParser {
|
||||
public static String sanitize(String word) {
|
||||
String sanitized = word;
|
||||
sanitized = sanitized.replaceAll("\\..+$", "");
|
||||
String shortened = sanitized;
|
||||
sanitized = sanitized.replaceAll("-","_");
|
||||
sanitized = sanitized.replaceAll("[^a-zA-Z0-9_]+", "");
|
||||
|
||||
if (!word.equals(sanitized)) {
|
||||
logger.warn("The identifier or value '" + word + "' was sanitized to '" + sanitized + "' to be compatible with monitoring systems. You should probably change this to make diagnostics easier.");
|
||||
if (!shortened.equals(sanitized)) {
|
||||
logger.warn("The identifier or value '" + shortened + "' was sanitized to '" + sanitized + "' to be compatible with monitoring systems. You should probably change this to make diagnostics easier.");
|
||||
}
|
||||
return sanitized;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user