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 classMetricUtil.MatchingTypeAn 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-trueif the name is absolute,falseif 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.MatchingTypeindicating the type of annotated element
-
-