Merge pull request #1519 from nosqlbench/nosqlbench-1517-namefixes

more metric name fixes for prom expo form
This commit is contained in:
Jonathan Shook 2023-09-07 11:26:38 -05:00 committed by GitHub
commit a33800f252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -34,7 +34,7 @@ public class ExceptionCountMetrics {
public ExceptionCountMetrics(final NBLabeledElement parentLabels) { public ExceptionCountMetrics(final NBLabeledElement parentLabels) {
this.parentLabels = parentLabels; this.parentLabels = parentLabels;
this.allerrors =ActivityMetrics.counter(parentLabels, "errorcounts.ALL"); this.allerrors =ActivityMetrics.counter(parentLabels, "errors_ALL");
} }
public void count(final String name) { public void count(final String name) {
@ -42,7 +42,7 @@ public class ExceptionCountMetrics {
if (null == c) synchronized (this.counters) { if (null == c) synchronized (this.counters) {
c = this.counters.computeIfAbsent( c = this.counters.computeIfAbsent(
name, name,
k -> ActivityMetrics.counter(this.parentLabels, "errorcounts." + name) k -> ActivityMetrics.counter(this.parentLabels, "errors_" + name)
); );
} }
c.inc(); c.inc();

View File

@ -31,8 +31,8 @@ public class ExceptionExpectedResultVerificationMetrics {
public ExceptionExpectedResultVerificationMetrics(final NBLabeledElement parentLabels) { public ExceptionExpectedResultVerificationMetrics(final NBLabeledElement parentLabels) {
this.parentLabels = parentLabels; this.parentLabels = parentLabels;
verificationRetries = ActivityMetrics.counter(parentLabels, "verificationcounts.RETRIES"); verificationRetries = ActivityMetrics.counter(parentLabels, "verificationcounts_RETRIES");
verificationErrors = ActivityMetrics.counter(parentLabels, "verificationcounts.ERRORS"); verificationErrors = ActivityMetrics.counter(parentLabels, "verificationcounts_ERRORS");
} }
public void countVerificationRetries() { public void countVerificationRetries() {

View File

@ -34,7 +34,7 @@ public class ExceptionMeterMetrics {
public ExceptionMeterMetrics(final NBLabeledElement parentLabels) { public ExceptionMeterMetrics(final NBLabeledElement parentLabels) {
this.parentLabels = parentLabels; this.parentLabels = parentLabels;
this.allerrors = ActivityMetrics.meter(parentLabels, "errormeters.ALL"); this.allerrors = ActivityMetrics.meter(parentLabels, "errormeters_ALL");
} }
public void mark(final String name) { public void mark(final String name) {
@ -42,7 +42,7 @@ public class ExceptionMeterMetrics {
if (null == c) synchronized (this.meters) { if (null == c) synchronized (this.meters) {
c = this.meters.computeIfAbsent( c = this.meters.computeIfAbsent(
name, name,
k -> ActivityMetrics.meter(this.parentLabels, "errormeters." + name) k -> ActivityMetrics.meter(this.parentLabels, "errormeters_" + name)
); );
} }
c.mark(); c.mark();

View File

@ -51,7 +51,7 @@ public class ExceptionTimerMetrics {
if (null == timer) synchronized (this.timers) { if (null == timer) synchronized (this.timers) {
timer = this.timers.computeIfAbsent( timer = this.timers.computeIfAbsent(
name, 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); timer.update(nanosDuration, TimeUnit.NANOSECONDS);

View File

@ -34,20 +34,20 @@ public class ActivityMetricsTest {
int extant = ActivityMetrics.getMetricRegistry().getMetrics().size(); int extant = ActivityMetrics.getMetricRegistry().getMetrics().size();
ActivityMetrics.mountSubRegistry("aprefixhere.",r1); ActivityMetrics.mountSubRegistry("aprefixhere_",r1);
Map<String, Metric> metrics = ActivityMetrics.getMetricRegistry().getMetrics(); Map<String, Metric> metrics = ActivityMetrics.getMetricRegistry().getMetrics();
assertThat(metrics).containsKey("aprefixhere.counter1"); assertThat(metrics).containsKey("aprefixhere_counter1");
assertThat(metrics).hasSize(extant+1); assertThat(metrics).hasSize(extant+1);
r1.counter("counter2"); r1.counter("counter2");
metrics = ActivityMetrics.getMetricRegistry().getMetrics(); metrics = ActivityMetrics.getMetricRegistry().getMetrics();
assertThat(metrics).hasSize(extant+2); assertThat(metrics).hasSize(extant+2);
assertThat(metrics).containsKey("aprefixhere.counter2"); assertThat(metrics).containsKey("aprefixhere_counter2");
r1.remove("counter1"); r1.remove("counter1");
metrics = ActivityMetrics.getMetricRegistry().getMetrics(); metrics = ActivityMetrics.getMetricRegistry().getMetrics();
assertThat(metrics).hasSize(extant+1); assertThat(metrics).hasSize(extant+1);
assertThat(metrics).containsKey("aprefixhere.counter2"); assertThat(metrics).containsKey("aprefixhere_counter2");
r1.remove("counter2"); r1.remove("counter2");
metrics = ActivityMetrics.getMetricRegistry().getMetrics(); metrics = ActivityMetrics.getMetricRegistry().getMetrics();