Package io.helidon.microprofile.metrics
Class MetricUtil
- 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.MatchingType
An enum used to indicate whether a metric annotation applies to a class or a method.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends Member & AnnotatedElement>
StringgetMetricName(E element, Class<?> clazz, MetricUtil.MatchingType matchingType, String explicitName, boolean absolute)
Determine the name to use for a metric.static <E extends Member & AnnotatedElement>
voidregisterMetric(E element, Class<?> clazz, io.helidon.microprofile.metrics.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
-
getMetricName
public static <E extends Member & AnnotatedElement> String getMetricName(E element, Class<?> clazz, MetricUtil.MatchingType matchingType, String explicitName, boolean absolute)
Determine the name to use for a metric.- Type Parameters:
E
- the type of the annotated element- Parameters:
element
- the annotated elementclazz
- the annotated classmatchingType
- the type that is annotatedexplicitName
- the optional explicit name to useabsolute
-true
if the name is absolute,false
if it is relative- Returns:
- the name to use for a metric
-
registerMetric
public static <E extends Member & AnnotatedElement> void registerMetric(E element, Class<?> clazz, io.helidon.microprofile.metrics.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
-
-