diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/metrics/BatchMetrics.java b/spring-batch-core/src/main/java/org/springframework/batch/core/metrics/BatchMetrics.java index 8384647da..e00eeb8c7 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/metrics/BatchMetrics.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/metrics/BatchMetrics.java @@ -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; * * @@ -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 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