mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge pull request #1519 from nosqlbench/nosqlbench-1517-namefixes
more metric name fixes for prom expo form
This commit is contained in:
commit
a33800f252
@ -34,7 +34,7 @@ public class ExceptionCountMetrics {
|
||||
|
||||
public ExceptionCountMetrics(final NBLabeledElement parentLabels) {
|
||||
this.parentLabels = parentLabels;
|
||||
this.allerrors =ActivityMetrics.counter(parentLabels, "errorcounts.ALL");
|
||||
this.allerrors =ActivityMetrics.counter(parentLabels, "errors_ALL");
|
||||
}
|
||||
|
||||
public void count(final String name) {
|
||||
@ -42,7 +42,7 @@ public class ExceptionCountMetrics {
|
||||
if (null == c) synchronized (this.counters) {
|
||||
c = this.counters.computeIfAbsent(
|
||||
name,
|
||||
k -> ActivityMetrics.counter(this.parentLabels, "errorcounts." + name)
|
||||
k -> ActivityMetrics.counter(this.parentLabels, "errors_" + name)
|
||||
);
|
||||
}
|
||||
c.inc();
|
||||
|
@ -31,8 +31,8 @@ public class ExceptionExpectedResultVerificationMetrics {
|
||||
|
||||
public ExceptionExpectedResultVerificationMetrics(final NBLabeledElement parentLabels) {
|
||||
this.parentLabels = parentLabels;
|
||||
verificationRetries = ActivityMetrics.counter(parentLabels, "verificationcounts.RETRIES");
|
||||
verificationErrors = ActivityMetrics.counter(parentLabels, "verificationcounts.ERRORS");
|
||||
verificationRetries = ActivityMetrics.counter(parentLabels, "verificationcounts_RETRIES");
|
||||
verificationErrors = ActivityMetrics.counter(parentLabels, "verificationcounts_ERRORS");
|
||||
}
|
||||
|
||||
public void countVerificationRetries() {
|
||||
|
@ -34,7 +34,7 @@ public class ExceptionMeterMetrics {
|
||||
|
||||
public ExceptionMeterMetrics(final NBLabeledElement parentLabels) {
|
||||
this.parentLabels = parentLabels;
|
||||
this.allerrors = ActivityMetrics.meter(parentLabels, "errormeters.ALL");
|
||||
this.allerrors = ActivityMetrics.meter(parentLabels, "errormeters_ALL");
|
||||
}
|
||||
|
||||
public void mark(final String name) {
|
||||
@ -42,7 +42,7 @@ public class ExceptionMeterMetrics {
|
||||
if (null == c) synchronized (this.meters) {
|
||||
c = this.meters.computeIfAbsent(
|
||||
name,
|
||||
k -> ActivityMetrics.meter(this.parentLabels, "errormeters." + name)
|
||||
k -> ActivityMetrics.meter(this.parentLabels, "errormeters_" + name)
|
||||
);
|
||||
}
|
||||
c.mark();
|
||||
|
@ -51,7 +51,7 @@ public class ExceptionTimerMetrics {
|
||||
if (null == timer) synchronized (this.timers) {
|
||||
timer = this.timers.computeIfAbsent(
|
||||
name,
|
||||
k -> ActivityMetrics.timer(this.parentLabels, "errortimers." + name, this.activityDef.getParams().getOptionalInteger("hdr_digits").orElse(4))
|
||||
k -> ActivityMetrics.timer(this.parentLabels, "errortimers_" + name, this.activityDef.getParams().getOptionalInteger("hdr_digits").orElse(4))
|
||||
);
|
||||
}
|
||||
timer.update(nanosDuration, TimeUnit.NANOSECONDS);
|
||||
|
@ -34,20 +34,20 @@ public class ActivityMetricsTest {
|
||||
|
||||
int extant = ActivityMetrics.getMetricRegistry().getMetrics().size();
|
||||
|
||||
ActivityMetrics.mountSubRegistry("aprefixhere.",r1);
|
||||
ActivityMetrics.mountSubRegistry("aprefixhere_",r1);
|
||||
Map<String, Metric> metrics = ActivityMetrics.getMetricRegistry().getMetrics();
|
||||
assertThat(metrics).containsKey("aprefixhere.counter1");
|
||||
assertThat(metrics).containsKey("aprefixhere_counter1");
|
||||
assertThat(metrics).hasSize(extant+1);
|
||||
|
||||
r1.counter("counter2");
|
||||
metrics = ActivityMetrics.getMetricRegistry().getMetrics();
|
||||
assertThat(metrics).hasSize(extant+2);
|
||||
assertThat(metrics).containsKey("aprefixhere.counter2");
|
||||
assertThat(metrics).containsKey("aprefixhere_counter2");
|
||||
|
||||
r1.remove("counter1");
|
||||
metrics = ActivityMetrics.getMetricRegistry().getMetrics();
|
||||
assertThat(metrics).hasSize(extant+1);
|
||||
assertThat(metrics).containsKey("aprefixhere.counter2");
|
||||
assertThat(metrics).containsKey("aprefixhere_counter2");
|
||||
|
||||
r1.remove("counter2");
|
||||
metrics = ActivityMetrics.getMetricRegistry().getMetrics();
|
||||
|
Loading…
Reference in New Issue
Block a user