caller updates for documented metrics

This commit is contained in:
Jonathan Shook 2023-12-20 18:12:30 -06:00
parent 84f9b84a6e
commit 3f6abf12f8
16 changed files with 285 additions and 54 deletions

View File

@ -16,6 +16,7 @@
package io.nosqlbench.engine.api.metrics;
import io.nosqlbench.nb.api.engine.metrics.instruments.MetricCategory;
import io.nosqlbench.nb.api.labels.NBLabels;
import io.nosqlbench.nb.api.engine.metrics.DeltaHdrHistogramReservoir;
import io.nosqlbench.nb.api.engine.metrics.HistoIntervalLogger;
@ -47,7 +48,14 @@ public class HistoIntervalLoggerTest {
final int significantDigits = 4;
NBMetricHistogram NBHistogram = new NBMetricHistogram(
NBLabels.forKV("name", "histo1"), new DeltaHdrHistogramReservoir(NBLabels.forKV("name", "histo1"), significantDigits));
NBLabels.forKV("name", "histo1"),
new DeltaHdrHistogramReservoir(
NBLabels.forKV("name", "histo1"),
significantDigits
),
"test basic logger",
MetricCategory.Verification
);
hil.onHistogramAdded("histo1", NBHistogram);

View File

@ -16,6 +16,7 @@
package io.nosqlbench.engine.api.metrics;
import io.nosqlbench.nb.api.engine.metrics.instruments.MetricCategory;
import io.nosqlbench.nb.api.labels.NBLabels;
import io.nosqlbench.nb.api.engine.metrics.ConvenientSnapshot;
import io.nosqlbench.nb.api.engine.metrics.DeltaHdrHistogramReservoir;
@ -28,8 +29,15 @@ public class NBMetricHistogramTest {
@Test
public void testNicerHistogramValues() {
NBMetricHistogram nh = new NBMetricHistogram(NBLabels.forKV("name","testhisto"), new DeltaHdrHistogramReservoir(
NBLabels.forKV("name", "testhisto"), 4));
NBMetricHistogram nh = new NBMetricHistogram(
NBLabels.forKV("name","testhisto"),
new DeltaHdrHistogramReservoir(
NBLabels.forKV("name", "testhisto"),
4
),
"test nicer histogram values",
MetricCategory.Verification
);
for (int i = 1; 100 >= i; i++) {
nh.update(i);
}

View File

@ -59,58 +59,62 @@ public class NBCreators {
public NBMetricTimer timer(String metricFamilyName, int hdrdigits, MetricCategory category, String description) {
NBLabels labels = base.getLabels().and("name", metricFamilyName);
NBMetricTimer timer = new NBMetricTimer(labels, new DeltaHdrHistogramReservoir(labels, hdrdigits));
NBMetricTimer timer = new NBMetricTimer(
labels,
new DeltaHdrHistogramReservoir(labels, hdrdigits),
description, category
);
base.addComponentMetric(timer, category, description);
return timer;
}
public Meter meter(String metricFamilyName, MetricCategory category, String requiredDescription) {
public Meter meter(String metricFamilyName, MetricCategory category, String description) {
NBLabels labels = base.getLabels().and("name", metricFamilyName);
NBMetricMeter meter = new NBMetricMeter(labels);
base.addComponentMetric(meter, category, requiredDescription);
NBMetricMeter meter = new NBMetricMeter(labels,description, category);
base.addComponentMetric(meter, category, description);
return meter;
}
public NBMetricCounter counter(String metricFamilyName, MetricCategory category, String requiredDescription) {
public NBMetricCounter counter(String metricFamilyName, MetricCategory category, String description) {
NBLabels labels = base.getLabels().and("name", metricFamilyName);
NBMetricCounter counter = new NBMetricCounter(labels);
base.addComponentMetric(counter, category, requiredDescription);
NBMetricCounter counter = new NBMetricCounter(labels, description, category);
base.addComponentMetric(counter, category, description);
return counter;
}
public NBFunctionGauge gauge(String metricFamilyName, Supplier<Double> valueSource, MetricCategory category, String requiredDescription) {
NBFunctionGauge gauge = new NBFunctionGauge(base, valueSource, metricFamilyName);
base.addComponentMetric(gauge, category, requiredDescription);
public NBFunctionGauge gauge(String metricFamilyName, Supplier<Double> valueSource, MetricCategory category, String description) {
NBFunctionGauge gauge = new NBFunctionGauge(base, valueSource, metricFamilyName, description, category);
base.addComponentMetric(gauge, category, description);
return gauge;
}
public NBVariableGauge variableGauge(String metricFamilyName, double initialValue, MetricCategory category, String requiredDescription, String... additionalLabels) {
NBVariableGauge gauge = new NBVariableGauge(base, metricFamilyName, initialValue, additionalLabels);
base.addComponentMetric(gauge, category, requiredDescription);
public NBVariableGauge variableGauge(String metricFamilyName, double initialValue, MetricCategory category, String description, NBLabels additionalLabels) {
NBVariableGauge gauge = new NBVariableGauge(base, metricFamilyName, initialValue, additionalLabels, description, category);
base.addComponentMetric(gauge, category, description);
return gauge;
}
public DoubleSummaryGauge summaryGauge(String name, List<String> statspecs, MetricCategory category, String requiredDescription) {
public DoubleSummaryGauge summaryGauge(String name, List<String> statspecs, MetricCategory category, String description) {
List<DoubleSummaryGauge.Stat> stats = statspecs.stream().map(DoubleSummaryGauge.Stat::valueOf).toList();
DoubleSummaryStatistics reservoir = new DoubleSummaryStatistics();
DoubleSummaryGauge anyGauge = null;
for (DoubleSummaryGauge.Stat stat : stats) {
anyGauge = new DoubleSummaryGauge(base.getLabels().and(NBLabels.forKV("name",name,"stat", stat)), stat, reservoir);
base.addComponentMetric(anyGauge, category, requiredDescription);
anyGauge = new DoubleSummaryGauge(base.getLabels().and(NBLabels.forKV("name",name,"stat", stat)), stat, reservoir, description, category);
base.addComponentMetric(anyGauge, category, description);
}
return anyGauge;
}
public NBMetricHistogram histogram(String metricFamilyName, MetricCategory category, String requiredDescription) {
return histogram(metricFamilyName,4, category, requiredDescription);
public NBMetricHistogram histogram(String metricFamilyName, MetricCategory category, String description) {
return histogram(metricFamilyName,4, category, description);
}
public NBMetricHistogram histogram(String metricFamilyName, int hdrdigits, MetricCategory category, String requiredDescription) {
public NBMetricHistogram histogram(String metricFamilyName, int hdrdigits, MetricCategory category, String description) {
NBLabels labels = base.getLabels().and("name", metricFamilyName);
NBMetricHistogram histogram = new NBMetricHistogram(labels, new DeltaHdrHistogramReservoir(labels, hdrdigits));
base.addComponentMetric(histogram, category, requiredDescription);
NBMetricHistogram histogram = new NBMetricHistogram(labels, new DeltaHdrHistogramReservoir(labels, hdrdigits), description, category);
base.addComponentMetric(histogram, category, description);
return histogram;
}

View File

@ -16,6 +16,7 @@
package io.nosqlbench.nb.api.engine.metrics;
import io.nosqlbench.nb.api.engine.metrics.instruments.MetricCategory;
import io.nosqlbench.nb.api.labels.NBLabels;
import io.nosqlbench.nb.api.engine.metrics.instruments.NBMetricGauge;
@ -30,12 +31,24 @@ public class DoubleSummaryGauge implements NBMetricGauge, DoubleConsumer {
private final NBLabels labels;
private final Stat stat;
private final DoubleSummaryStatistics stats;
private final String description;
private final MetricCategory[] categories;
@Override
public String typeName() {
return "gauge";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
public enum Stat {
Min,
Max,
@ -44,16 +57,20 @@ public class DoubleSummaryGauge implements NBMetricGauge, DoubleConsumer {
Sum
}
public DoubleSummaryGauge(NBLabels labels, Stat stat, DoubleSummaryStatistics stats) {
public DoubleSummaryGauge(NBLabels labels, Stat stat, DoubleSummaryStatistics stats, String description, MetricCategory... categories) {
this.labels = labels;
this.stat = stat;
this.stats = stats;
this.description = description;
this.categories = categories;
}
public DoubleSummaryGauge(NBLabels labels, Stat stat) {
public DoubleSummaryGauge(NBLabels labels, Stat stat,String description, MetricCategory... categories) {
this.labels = labels;
this.stat = stat;
this.stats = new DoubleSummaryStatistics();
this.description = description;
this.categories = categories;
}
public synchronized void accept(double value) {

View File

@ -20,9 +20,13 @@ import io.nosqlbench.nb.api.labels.NBLabels;
public class NBBaseMetric implements NBMetric {
private final NBLabels labels;
private String description;
private MetricCategory[] categories;
public NBBaseMetric(String... labels) {
this.labels = NBLabels.forKV((Object[]) labels);
public NBBaseMetric(NBLabels labels, String description, MetricCategory... categories) {
this.labels = labels;
this.description = description;
this.categories = categories;
}
@Override
public NBLabels getLabels() {
@ -33,4 +37,14 @@ public class NBBaseMetric implements NBMetric {
public String typeName() {
return "basetype";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
}

View File

@ -28,14 +28,31 @@ public class NBFunctionGauge implements NBMetricGauge {
private final Supplier<Double> source;
private final NBLabeledElement parent;
private final NBLabels labels;
private String description;
private MetricCategory[] categories;
public NBFunctionGauge(NBComponent parent, Supplier<Double> source, String metricFamilyName, Map<String,String> additionalLabels) {
public NBFunctionGauge(
NBComponent parent,
Supplier<Double> source,
String metricFamilyName,
Map<String,String> additionalLabels,
String description,
MetricCategory... categories
) {
this.parent = parent;
this.labels = NBLabels.forMap(additionalLabels).and("name",metricFamilyName);
this.source = source;
this.description = description;
this.categories = categories;
}
public NBFunctionGauge(NBComponent parent, Supplier<Double> source, String metricFamilyName) {
this(parent, source, metricFamilyName,Map.of());
public NBFunctionGauge(
NBComponent parent,
Supplier<Double> source,
String metricFamilyName,
String description,
MetricCategory... categories
) {
this(parent, source, metricFamilyName,Map.of(), description, categories);
}
@Override
public Double getValue() {
@ -56,6 +73,16 @@ public class NBFunctionGauge implements NBMetricGauge {
public String typeName() {
return "gauge";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
}

View File

@ -24,4 +24,7 @@ public interface NBMetric extends Metric, NBLabeledElement {
return this.getLabels().linearizeAsMetrics();
}
String typeName();
String getDescription();
MetricCategory[] getCategories();
}

View File

@ -22,9 +22,13 @@ import io.nosqlbench.nb.api.labels.NBLabels;
public class NBMetricCounter extends Counter implements NBMetric {
private final NBLabels labels;
private String description;
private MetricCategory[] categories;
public NBMetricCounter(final NBLabels labels) {
public NBMetricCounter(final NBLabels labels, String description, MetricCategory... categories) {
this.labels = labels;
this.description = description;
this.categories = categories;
}
@Override
@ -37,6 +41,16 @@ public class NBMetricCounter extends Counter implements NBMetric {
return "counter";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
@Override
public String toString() {
return description();

View File

@ -23,14 +23,18 @@ public class NBMetricGaugeWrapper implements NBMetricGauge, NBMetric {
private final Gauge<Double> gauge;
private final NBLabels labels;
private final String description;
private final MetricCategory[] categories;
public NBMetricGaugeWrapper(NBLabels labels, Gauge<Double> gauge) {
public NBMetricGaugeWrapper(NBLabels labels, Gauge<Double> gauge, String description, MetricCategory... categories) {
this.gauge = gauge;
if (gauge.getValue() instanceof Double d) {
} else {
throw new RuntimeException("NBMetricGauges only support Double values");
}
this.labels = labels;
this.description = description;
this.categories = categories;
}
@Override
@ -47,4 +51,14 @@ public class NBMetricGaugeWrapper implements NBMetricGauge, NBMetric {
public String typeName() {
return "gauge";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
}

View File

@ -31,17 +31,33 @@ public class NBMetricHistogram extends Histogram implements DeltaSnapshotter, Hd
private long cacheExpiryMillis;
private long cacheTimeMillis;
private List<Histogram> mirrors;
private MetricCategory[] categories;
private String description;
public NBMetricHistogram(NBLabels labels, DeltaHdrHistogramReservoir hdrHistogramReservoir) {
public NBMetricHistogram(
NBLabels labels,
DeltaHdrHistogramReservoir hdrHistogramReservoir,
String description,
MetricCategory... categories
) {
super(hdrHistogramReservoir);
this.labels = labels;
this.hdrDeltaReservoir = hdrHistogramReservoir;
this.description = description;
this.categories = categories;
}
public NBMetricHistogram(String name, DeltaHdrHistogramReservoir hdrHistogramReservoir) {
public NBMetricHistogram(
String name,
DeltaHdrHistogramReservoir hdrHistogramReservoir,
String description,
MetricCategory... categories
) {
super(hdrHistogramReservoir);
this.labels = NBLabels.forKV("name",name);
this.hdrDeltaReservoir = hdrHistogramReservoir;
this.description = description;
this.categories = categories;
}
@Override
@ -76,7 +92,7 @@ public class NBMetricHistogram extends Histogram implements DeltaSnapshotter, Hd
mirrors = new CopyOnWriteArrayList<>();
}
DeltaHdrHistogramReservoir mirrorReservoir = this.hdrDeltaReservoir.copySettings();
NBMetricHistogram mirror = new NBMetricHistogram("mirror-" + this.labels.linearizeValues("name"), mirrorReservoir);
NBMetricHistogram mirror = new NBMetricHistogram("mirror-" + this.labels.linearizeValues("name"), mirrorReservoir, description, categories);
mirrors.add(mirror);
return mirror;
}
@ -115,6 +131,16 @@ public class NBMetricHistogram extends Histogram implements DeltaSnapshotter, Hd
return "histogram";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
@Override
public String toString() {
return description();

View File

@ -22,9 +22,13 @@ import io.nosqlbench.nb.api.labels.NBLabels;
public class NBMetricMeter extends Meter implements NBMetric {
private final NBLabels labels;
private final MetricCategory[] categories;
private final String description;
public NBMetricMeter(NBLabels labels) {
public NBMetricMeter(NBLabels labels, String description, MetricCategory... categories) {
this.labels = labels;
this.description = description;
this.categories = categories;
}
@Override
@ -36,4 +40,14 @@ public class NBMetricMeter extends Meter implements NBMetric {
public String typeName() {
return "meter";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
}

View File

@ -28,12 +28,21 @@ import java.util.concurrent.TimeUnit;
public class NBMetricTimer extends Timer implements DeltaSnapshotter, HdrDeltaHistogramAttachment, TimerAttachment, NBMetric {
private final DeltaHdrHistogramReservoir deltaHdrHistogramReservoir;
private final String description;
private final MetricCategory[] categories;
private long cacheExpiry;
private List<Timer> mirrors;
private final NBLabels labels;
public NBMetricTimer(final NBLabels labels, final DeltaHdrHistogramReservoir deltaHdrHistogramReservoir) {
public NBMetricTimer(
final NBLabels labels,
final DeltaHdrHistogramReservoir deltaHdrHistogramReservoir,
String description,
MetricCategory... categories
) {
super(deltaHdrHistogramReservoir);
this.description = description;
this.categories = categories;
this.labels = labels;
this.deltaHdrHistogramReservoir = deltaHdrHistogramReservoir;
}
@ -60,7 +69,7 @@ public class NBMetricTimer extends Timer implements DeltaSnapshotter, HdrDeltaHi
public synchronized NBMetricTimer attachHdrDeltaHistogram() {
if (null == mirrors) this.mirrors = new CopyOnWriteArrayList<>();
final DeltaHdrHistogramReservoir sameConfigReservoir = deltaHdrHistogramReservoir.copySettings();
final NBMetricTimer mirror = new NBMetricTimer(labels, sameConfigReservoir);
final NBMetricTimer mirror = new NBMetricTimer(labels, sameConfigReservoir, description, categories);
this.mirrors.add(mirror);
return mirror;
}
@ -96,4 +105,14 @@ public class NBMetricTimer extends Timer implements DeltaSnapshotter, HdrDeltaHi
public String typeName() {
return "timer";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
}

View File

@ -28,11 +28,22 @@ public class NBVariableGauge implements NBMetricGauge {
private double value;
private final NBLabeledElement parent;
private final NBLabels labels;
private String description;
private MetricCategory[] categories;
public NBVariableGauge(NBComponent parent, String metricFamilyName, double initialValue, String... additionalLabels) {
public NBVariableGauge(
NBComponent parent,
String metricFamilyName,
double initialValue,
NBLabels additionalLabels,
String description,
MetricCategory... categories
) {
this.parent = parent;
this.labels = NBLabels.forKV((Object[]) additionalLabels).and("name", metricFamilyName);
this.labels = additionalLabels.and("name", metricFamilyName);
this.value = initialValue;
this.description = description;
this.categories = categories;
}
@ -50,4 +61,14 @@ public class NBVariableGauge implements NBMetricGauge {
public String typeName() {
return "gauge";
}
@Override
public String getDescription() {
return this.description;
}
@Override
public MetricCategory[] getCategories() {
return this.categories;
}
}

View File

@ -20,6 +20,7 @@ import io.nosqlbench.nb.api.components.core.NBBaseComponentMetrics;
import io.nosqlbench.nb.api.engine.metrics.instruments.MetricCategory;
import io.nosqlbench.nb.api.engine.metrics.instruments.NBBaseMetric;
import io.nosqlbench.nb.api.engine.metrics.instruments.NBMetric;
import io.nosqlbench.nb.api.labels.NBLabels;
import org.junit.jupiter.api.Test;
import java.util.List;
@ -31,13 +32,13 @@ class NBBaseComponentMetricsTest {
@Test
void testBasicAddAndLookup() {
NBBaseComponentMetrics cm = new NBBaseComponentMetrics();
NBMetric m1 = new NBBaseMetric("k","20");
NBMetric m1 = new NBBaseMetric(NBLabels.forKV("k","20"),"test metric", MetricCategory.Verification);
String m1Handle = cm.addComponentMetric(
m1,
MetricCategory.Verification,
"testing metric"
);
NBMetric m2 = new NBBaseMetric("k","27","l","62");
NBMetric m2 = new NBBaseMetric(NBLabels.forKV("k","27","l","62"),"test metric", MetricCategory.Verification);
String m2Handle = cm.addComponentMetric(
m2,
MetricCategory.Verification,
@ -50,13 +51,13 @@ class NBBaseComponentMetricsTest {
@Test
void find() {
NBBaseComponentMetrics cm = new NBBaseComponentMetrics();
NBMetric m1 = new NBBaseMetric("k","20");
NBMetric m1 = new NBBaseMetric(NBLabels.forKV("k","20"),"test metric", MetricCategory.Verification);
String m1Handle = cm.addComponentMetric(
m1,
MetricCategory.Verification,
"testing metric"
);
NBMetric m2 = new NBBaseMetric("k","27","l","62");
NBMetric m2 = new NBBaseMetric(NBLabels.forKV("k","27","l","62"),"test metric", MetricCategory.Verification);
String m2Handle = cm.addComponentMetric(
m2,
MetricCategory.Verification,

View File

@ -20,6 +20,7 @@ import io.nosqlbench.nb.api.config.standard.TestComponent;
import io.nosqlbench.nb.api.engine.metrics.instruments.MetricCategory;
import io.nosqlbench.nb.api.engine.metrics.instruments.NBBaseMetric;
import io.nosqlbench.nb.api.engine.metrics.instruments.NBMetric;
import io.nosqlbench.nb.api.labels.NBLabels;
import org.junit.jupiter.api.Test;
import java.util.List;
@ -31,19 +32,31 @@ class NBMetricsQueryTest {
private final static TestComponent root = new TestComponent("root","root","type","rootelement");
private final static TestComponent root_c2 = new TestComponent(root,"c2","c2");
private final static TestComponent root_c3 = new TestComponent(root,"c3","c3");
private final static NBMetric m1 = new NBBaseMetric("m1","m1");
private final static NBMetric m1 = new NBBaseMetric(
NBLabels.forKV("m1", "m1"),
"test metric",
MetricCategory.Verification
);
private final static String m1Handle = root.addComponentMetric(
m1,
MetricCategory.Verification,
"testing metric"
);
private final static NBMetric m2 = new NBBaseMetric("m2","m2");
private final static NBMetric m2 = new NBBaseMetric(
NBLabels.forKV("m2", "m2"),
"test metric",
MetricCategory.Verification
);
private final static String m2Handle = root_c2.addComponentMetric(
m2,
MetricCategory.Verification,
"testing metric"
);
private final static NBMetric m3 = new NBBaseMetric("m3","m3");
private final static NBMetric m3 = new NBBaseMetric(
NBLabels.forKV("m3", "m3"),
"test metric",
MetricCategory.Verification
);
private final static String m3Handle = root_c3.addComponentMetric(
m3,
MetricCategory.Verification,

View File

@ -46,7 +46,11 @@ public class PromExpositionFormatTest {
}
@Test
public void testCounterFormat() {
Counter counter = new NBMetricCounter(NBLabels.forKV("name","counter_test_2342", "origin","mars"));
Counter counter = new NBMetricCounter(
NBLabels.forKV("name","counter_test_2342", "origin","mars"),
"test counter format",
MetricCategory.Verification
);
counter.inc(23423L);
String buffer = PromExpositionFormat.format(nowclock, counter);
@ -64,7 +68,12 @@ public class PromExpositionFormatTest {
for (long i = 0; 1000 > i; i++) {
hdr.update(i * 37L);
}
NBMetricHistogram nbHistogram = new NBMetricHistogram(NBLabels.forKV("name","mynameismud","label3", "value3"), hdr);
NBMetricHistogram nbHistogram = new NBMetricHistogram(
NBLabels.forKV("name","mynameismud","label3", "value3"),
hdr,
"test histogram format",
MetricCategory.Verification
);
String formatted = PromExpositionFormat.format(nowclock, nbHistogram);
assertThat(formatted).matches(Pattern.compile("""
@ -95,7 +104,12 @@ public class PromExpositionFormatTest {
public void testTimerFormat() {
DeltaHdrHistogramReservoir hdr = new DeltaHdrHistogramReservoir(NBLabels.forKV("name","monsieurmarius","label4","value4"),3);
NBMetricTimer nbMetricTimer = new NBMetricTimer(NBLabels.forKV("name","monsieurmarius","label4", "value4"), hdr);
NBMetricTimer nbMetricTimer = new NBMetricTimer(
NBLabels.forKV("name","monsieurmarius","label4", "value4"),
hdr,
"test timer format",
MetricCategory.Verification
);
for (long i = 0; 1000 > i; i++)
nbMetricTimer.update(i * 37L, TimeUnit.NANOSECONDS);
@ -135,7 +149,11 @@ public class PromExpositionFormatTest {
@Test
public void testMeterFormat() {
NBMetricMeter nbMetricMeter = new NBMetricMeter(NBLabels.forKV("name","eponine","label5", "value5"));
NBMetricMeter nbMetricMeter = new NBMetricMeter(
NBLabels.forKV("name","eponine","label5", "value5"),
"test meter format",
MetricCategory.Verification
);
String formatted = PromExpositionFormat.format(nowclock, nbMetricMeter);
assertThat(formatted).matches(Pattern.compile("""
@ -155,7 +173,12 @@ public class PromExpositionFormatTest {
@Test
public void testGaugeFormat() {
Gauge cosetteGauge = () -> 1500d;
NBMetricGauge nbMetricGauge = new NBMetricGaugeWrapper(NBLabels.forKV("name","cosette","label6", "value6"), cosetteGauge);
NBMetricGauge nbMetricGauge = new NBMetricGaugeWrapper(
NBLabels.forKV("name","cosette","label6", "value6"),
cosetteGauge,
"test gauge format",
MetricCategory.Verification
);
String formatted = PromExpositionFormat.format(nowclock, nbMetricGauge);
assertThat(formatted).matches(Pattern.compile("""
@ -164,7 +187,12 @@ public class PromExpositionFormatTest {
"""));
Gauge cosetteGauge2 = () -> 2000.0d;
NBMetricGauge nbMetricGauge2 = new NBMetricGaugeWrapper(NBLabels.forKV("name","cosette2","label7", "value7"), cosetteGauge2);
NBMetricGauge nbMetricGauge2 = new NBMetricGaugeWrapper(
NBLabels.forKV("name","cosette2","label7", "value7"),
cosetteGauge2,
"test gauge format 2",
MetricCategory.Verification
);
String formatted2 = PromExpositionFormat.format(nowclock, nbMetricGauge2);
assertThat(formatted2).matches(Pattern.compile("""