From 63d3e4e043bd5ae8c2d7ab71bac6c89dcff1fd8f Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Fri, 6 Sep 2019 14:52:25 +0200 Subject: [PATCH] Remove unused methods in BatchMetrics Related to BATCH-2774 (See PR #690) --- .../batch/core/metrics/BatchMetrics.java | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) 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