- 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 classMetricUtil.LookupResult<A extends Annotation>Deprecated.This class is made public to migrate from metrics1 to metrics2 for gRPC, this should be refactoredstatic classMetricUtil.MatchingTypeDeprecated.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(E element, Class<?> clazz, MetricUtil.MatchingType matchingType, String explicitName, boolean absolute)This method is intended only for other Helidon components.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.
-
-
-
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.- Type Parameters:
E- element typeA- annotation type- Parameters:
element- elementannotClass- annotation classclazz- class- Returns:
- lookup result
-
getMetricName
public static <E extends Member & AnnotatedElement> String getMetricName(E element, Class<?> clazz, MetricUtil.MatchingType matchingType, String explicitName, boolean absolute)
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
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.MatchingTypeindicating the type of annotated element
-
-