more metric name fixes for prom expo form

This commit is contained in:
Jonathan Shook 2023-09-07 09:59:06 -05:00
parent be4ef9c34f
commit 23cccdfbfe
5 changed files with 11 additions and 11 deletions

View File

@ -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();

View File

@ -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() {

View File

@ -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();

View File

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

View File

@ -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();