ampofila ampofila - 10 months ago 59
Java Question

Spring Actuator Custom Metrics (avg, min, max response times)

Is there a way to produce avg response time per request, min response time per request and max response time per request? I suppose I could use Atomic variables or synchronization per request to avoid race conditions but I am not sure if this is the best way.

Answer Source

The solution to this problem is to use dropwizard metrics Timer. Unfortunately we are facing the exact same issue described here which is a limitation of the API. But overall this can do the job.