Remove unused methods in BatchMetrics
Related to BATCH-2774 (See PR #690)
This commit is contained in:
@@ -19,10 +19,7 @@ import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import io.micrometer.core.instrument.Counter;
|
||||
import io.micrometer.core.instrument.Gauge;
|
||||
import io.micrometer.core.instrument.LongTaskTimer;
|
||||
import io.micrometer.core.instrument.Metrics;
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
@@ -35,7 +32,7 @@ import org.springframework.lang.Nullable;
|
||||
*
|
||||
* <ul>
|
||||
* <li>the main entry point to interact with Micrometer's {@link Metrics#globalRegistry}
|
||||
* with common metrics such as {@link Timer}, {@link Counter} and {@link Gauge}.</li>
|
||||
* with common metrics such as {@link Timer} and {@link LongTaskTimer}.</li>
|
||||
* <li>Some utility methods like calculating durations and formatting them in
|
||||
* a human readable format.</li>
|
||||
* </ul>
|
||||
@@ -91,35 +88,6 @@ public final class BatchMetrics {
|
||||
.register(Metrics.globalRegistry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link Counter}.
|
||||
* @param name of the counter. Will be prefixed with {@link BatchMetrics#METRICS_PREFIX}.
|
||||
* @param description of the counter
|
||||
* @param tags of the counter
|
||||
* @return a new counter instance
|
||||
*/
|
||||
public static Counter createCounter(String name, String description, Tag... tags) {
|
||||
return Counter.builder(METRICS_PREFIX + name)
|
||||
.description(description)
|
||||
.tags(Arrays.asList(tags))
|
||||
.register(Metrics.globalRegistry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@link Gauge}.
|
||||
* @param name of the gauge. Will be prefixed with {@link BatchMetrics#METRICS_PREFIX}.
|
||||
* @param description of the gauge
|
||||
* @param supplier A supplier that yields a value for the gauge.
|
||||
* @param tags of the gauge
|
||||
* @return a new gauge instance
|
||||
*/
|
||||
public static Gauge createGauge(String name, String description, Supplier<Number> supplier, Tag... tags) {
|
||||
return Gauge.builder(METRICS_PREFIX + name, supplier)
|
||||
.description(description)
|
||||
.tags(Arrays.asList(tags))
|
||||
.register(Metrics.globalRegistry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the duration between two dates.
|
||||
* @param startTime the start time
|
||||
|
||||
Reference in New Issue
Block a user