metrics-spring
metrics-spring copied to clipboard
Added support for @CompositeTimed annotation
It can be sometimes useful having different timers on a method to avoid failing events to falsify the overall timing statistics. The @CompositeTimed annotation adds 3 timers on a method call:
- a failure timer that tracks the duration of the method when an exception occurs
- a success timer for methods calls that end successfully
- an overall timer
@CompositeTimed(name="compositeMethod", failedSuffix = "Fail", successSuffix = "Success", absolute = true)
public void compositeTimedMethod() throws Exception
{
....
}
will create compositeMethod, compositeMethodSuccess and compositeMethodFail timers.
Hope this can help.