Package io.micrometer.core.aop
Class TimedAspect
java.lang.Object
io.micrometer.core.aop.TimedAspect
@NonNullApi @Incubating(since="1.0.0") public class TimedAspect extends java.lang.Object
AspectJ aspect for intercepting types or methods annotated with
@Timed
.- Since:
- 1.0.0
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_EXCEPTION_TAG_VALUE
static java.lang.String
DEFAULT_METRIC_NAME
static java.lang.String
EXCEPTION_TAG
Tag key for an exception. -
Constructor Summary
Constructors Constructor Description TimedAspect()
Create aTimedAspect
instance withMetrics.globalRegistry
.TimedAspect(MeterRegistry registry)
TimedAspect(MeterRegistry registry, java.util.function.Function<org.aspectj.lang.ProceedingJoinPoint,java.lang.Iterable<Tag>> tagsBasedOnJoinPoint)
-
Method Summary
Modifier and Type Method Description java.lang.Object
timedMethod(org.aspectj.lang.ProceedingJoinPoint pjp)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
DEFAULT_METRIC_NAME
public static final java.lang.String DEFAULT_METRIC_NAME- See Also:
- Constant Field Values
-
DEFAULT_EXCEPTION_TAG_VALUE
public static final java.lang.String DEFAULT_EXCEPTION_TAG_VALUE- See Also:
- Constant Field Values
-
EXCEPTION_TAG
public static final java.lang.String EXCEPTION_TAGTag key for an exception.- Since:
- 1.1.0
- See Also:
- Constant Field Values
-
-
Constructor Details
-
TimedAspect
public TimedAspect()Create aTimedAspect
instance withMetrics.globalRegistry
.- Since:
- 1.2.0
-
TimedAspect
-
TimedAspect
public TimedAspect(MeterRegistry registry, java.util.function.Function<org.aspectj.lang.ProceedingJoinPoint,java.lang.Iterable<Tag>> tagsBasedOnJoinPoint)
-
-
Method Details
-
timedMethod
public java.lang.Object timedMethod(org.aspectj.lang.ProceedingJoinPoint pjp) throws java.lang.Throwable- Throws:
java.lang.Throwable
-