Class MetricUtil


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

      • lookupAnnotation

        @Deprecated
        public static <E extends Member & AnnotatedElement,​A extends AnnotationMetricUtil.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 type
        A - annotation type
        Parameters:
        element - element
        annotClass - annotation class
        clazz - class
        Returns:
        lookup result
      • getMetricName

        @Deprecated
        public static <E extends Member & AnnotatedElementString 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 method
        clazz - class
        matchingType - type to match
        explicitName - name
        absolute - 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 metric
        element - the annotated element
        clazz - the annotated class
        annotation - the annotation to register
        type - the MetricUtil.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 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