- java.lang.Object
-
- io.helidon.microprofile.metrics.MetricUtil
-
public final class MetricUtil extends Object
Class MetricUtil.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetricUtil.LookupResult<A extends Annotation>
Deprecated.This class is made public to migrate from metrics1 to metrics2 for gRPC, this should be refactoredstatic class
MetricUtil.MatchingType
Deprecated.This class is made public to migrate from metrics1 to metrics2 for gRPC, this should be refactored
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <E extends Member & AnnotatedElement>
StringgetMetricName(Member element, Class<?> clazz, MetricUtil.MatchingType matchingType, String explicitName, boolean absolute)
Deprecated.static <E extends Member & AnnotatedElement,A extends Annotation>
MetricUtil.LookupResult<A>lookupAnnotation(E element, Class<? extends Annotation> annotClass, Class<?> clazz)
Deprecated.This method is made public to migrate from metrics1 to metrics2 for gRPC, this should be refactored.static <E extends Member & AnnotatedElement>
voidregisterMetric(E element, Class<?> clazz, MetricUtil.LookupResult<? extends Annotation> lookupResult)
Register a metric.static <E extends Member & AnnotatedElement>
voidregisterMetric(E element, Class<?> clazz, Annotation annotation, MetricUtil.MatchingType type)
Register a metric.static <E extends Member & AnnotatedElement>
voidregisterMetric(MetricRegistry registry, E element, Class<?> clazz, Annotation annotation, MetricUtil.MatchingType type)
Deprecated.
-
-
-
Method Detail
-
lookupAnnotation
@Deprecated public static <E extends Member & AnnotatedElement,A extends Annotation> MetricUtil.LookupResult<A> lookupAnnotation(E element, Class<? extends Annotation> annotClass, Class<?> clazz)
Deprecated.This method is made public to migrate from metrics1 to metrics2 for gRPC, this should be refactored. This method will be removed outside of major version of Helidon.DO NOT USE THIS METHOD please, it will be removed.Instead, see
MetricUtil.MatchingType
.- Type Parameters:
E
- element typeA
- annotation type- Parameters:
element
- elementannotClass
- annotation classclazz
- class- Returns:
- lookup result
-
getMetricName
@Deprecated public static <E extends Member & AnnotatedElement> String getMetricName(Member element, Class<?> clazz, MetricUtil.MatchingType matchingType, String explicitName, boolean absolute)
Deprecated.This method is intended only for other Helidon components.- Type Parameters:
E
- type of element- Parameters:
element
- such as methodclazz
- classmatchingType
- type to matchexplicitName
- nameabsolute
- if absolute- Returns:
- name of the metric
-
registerMetric
@Deprecated public static <E extends Member & AnnotatedElement> void registerMetric(MetricRegistry registry, E element, Class<?> clazz, Annotation annotation, MetricUtil.MatchingType type)
Deprecated.Register a metric.- Type Parameters:
E
- the annotated element type- Parameters:
registry
- the metric registry in which to register the metricelement
- the annotated elementclazz
- the annotated classannotation
- the annotation to registertype
- theMetricUtil.MatchingType
indicating the type of annotated element
-
registerMetric
public static <E extends Member & AnnotatedElement> void registerMetric(E element, Class<?> clazz, MetricUtil.LookupResult<? extends Annotation> lookupResult)
Register a metric.- Type Parameters:
E
- the annotated element type- Parameters:
element
- the annotated elementclazz
- the annotated classlookupResult
- the annotation lookup result
-
registerMetric
public static <E extends Member & AnnotatedElement> void registerMetric(E element, Class<?> clazz, Annotation annotation, MetricUtil.MatchingType type)
Register a metric.- Type Parameters:
E
- the annotated element type- Parameters:
element
- the annotated elementclazz
- the annotated classannotation
- the annotation to registertype
- theMetricUtil.MatchingType
indicating the type of annotated element
-
-