metrics-spring icon indicating copy to clipboard operation
metrics-spring copied to clipboard

Added support for @CompositeTimed annotation

Open alex859 opened this issue 9 years ago • 0 comments

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.

alex859 avatar Sep 07 '15 21:09 alex859