Class MetricUtil


  • public final class MetricUtil
    extends Object
    Class MetricUtil.
    • Method Detail

      • getMetricName

        public static <E extends Member & AnnotatedElementString 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 element
        clazz - the annotated class
        matchingType - the type that is annotated
        explicitName - the optional explicit name to use
        absolute - 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 element
        clazz - the annotated class
        lookupResult - 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 element
        clazz - the annotated class
        annotation - the annotation to register
        type - the MetricUtil.MatchingType indicating the type of annotated element