Ajouter une metrique (Better way - Aspect)
Definir des aspects
@Around("execution(public * fully.qualified.name.MyClass.myMethod())")
public Object duration(ProceedingJoinPoint joinPoint)
throws Throwable {
Instant startTime = Instant.now();
try {
return joinPoint.proceed(joinPoint.getArgs());
} finally {
timer.record(Duration.between(startTime, Instant.now()));
}
}