diff --git a/core/src/main/java/com/kumuluz/ee/metrics/MetricsExtension.java b/core/src/main/java/com/kumuluz/ee/metrics/MetricsExtension.java index ac48ad0..c9e8561 100644 --- a/core/src/main/java/com/kumuluz/ee/metrics/MetricsExtension.java +++ b/core/src/main/java/com/kumuluz/ee/metrics/MetricsExtension.java @@ -293,7 +293,7 @@ public long getCount() { } }; } else { - return (Gauge) ((com.codahale.metrics.Gauge) metric)::getValue; + return (Gauge) ((com.codahale.metrics.Gauge) metric)::getValue; } } else { return null; diff --git a/core/src/main/java/com/kumuluz/ee/metrics/api/ForwardingGauge.java b/core/src/main/java/com/kumuluz/ee/metrics/api/ForwardingGauge.java index 336a6fe..834c07c 100644 --- a/core/src/main/java/com/kumuluz/ee/metrics/api/ForwardingGauge.java +++ b/core/src/main/java/com/kumuluz/ee/metrics/api/ForwardingGauge.java @@ -32,7 +32,7 @@ * @author Aljaž Blažej * @since 1.0.0 */ -public class ForwardingGauge implements Gauge { +public class ForwardingGauge implements Gauge { private final Method method; @@ -45,8 +45,8 @@ public ForwardingGauge(Method method, Object object) { } @Override - public Object getValue() { - return invokeMethod(method, object); + public Number getValue() { + return (Number) invokeMethod(method, object); } private static Object invokeMethod(Method method, Object object) { diff --git a/core/src/main/java/com/kumuluz/ee/metrics/producers/MetricProducer.java b/core/src/main/java/com/kumuluz/ee/metrics/producers/MetricProducer.java index 13ef69a..0829903 100644 --- a/core/src/main/java/com/kumuluz/ee/metrics/producers/MetricProducer.java +++ b/core/src/main/java/com/kumuluz/ee/metrics/producers/MetricProducer.java @@ -79,7 +79,7 @@ public Histogram produceHistogram(InjectionPoint injectionPoint) { @SuppressWarnings("unchecked") @Produces - public Gauge produceGauge(InjectionPoint injectionPoint) { + public Gauge produceGauge(InjectionPoint injectionPoint) { MetadataWithTags metadataWithTags = AnnotationMetadata.buildProducerMetadata(injectionPoint, MetricType.GAUGE); return () -> (T) applicationRegistry.getGauges().get(metadataWithTags.getMetricID()).getValue(); diff --git a/pom.xml b/pom.xml index 88e623d..245e1bd 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 3.6.0 1.3.0 - 2.2.1 + 2.1.0 4.1.0 2.9.9