Search in sources :

Example 1 with TimedSet

use of io.micrometer.core.annotation.TimedSet in project micrometer by micrometer-metrics.

the class TimedFinder method findTimedAnnotations.

Set<Timed> findTimedAnnotations(AnnotatedElement element) {
    Timed t = annotationFinder.findAnnotation(element, Timed.class);
    if (t != null)
        return Collections.singleton(t);
    TimedSet ts = annotationFinder.findAnnotation(element, TimedSet.class);
    if (ts != null) {
        return Arrays.stream(ts.value()).collect(Collectors.toSet());
    }
    return Collections.emptySet();
}
Also used : TimedSet(io.micrometer.core.annotation.TimedSet) Timed(io.micrometer.core.annotation.Timed)

Example 2 with TimedSet

use of io.micrometer.core.annotation.TimedSet in project micrometer by micrometer-metrics.

the class TimedUtils method findTimedAnnotations.

public static Set<Timed> findTimedAnnotations(AnnotatedElement element) {
    Timed t = AnnotationUtils.findAnnotation(element, Timed.class);
    // noinspection ConstantConditions
    if (t != null)
        return Collections.singleton(t);
    TimedSet ts = AnnotationUtils.findAnnotation(element, TimedSet.class);
    if (ts != null) {
        return Arrays.stream(ts.value()).collect(Collectors.toSet());
    }
    return Collections.emptySet();
}
Also used : TimedSet(io.micrometer.core.annotation.TimedSet) Timed(io.micrometer.core.annotation.Timed)

Aggregations

Timed (io.micrometer.core.annotation.Timed)2 TimedSet (io.micrometer.core.annotation.TimedSet)2