FAQ Database Discussion Community

Why ever use CachedGauage in Dropwizard Metrics?

I see there is the CachedGauge in the DropWizard Metrics (formerly Coda Hale Metrics) lib. I'm wondering why anyone would ever use this?!? My understanding of the value of a metric is that it is real-time, accurate and relevant. If a metric is reporting a stale/cached value, of what purpose...

Codahale Metrics: using @Timed metrics annotation in plain Java

I am trying to add metrics to a plain Java application using codahale metrics. I'd like to use the @Timed annotation, but it is unclear to me which MetricRegistry it uses, or how to tell it which MetricRegistry to use. The application is a plain Java 8 application, built with...

How do I get the last elapsed time from Codahale metrics timers?

I'm using the Codahale metrics in my Scala application, but don't seem to see a way to get the last value for a timed operation. I can get mean, median, and percentiles - all great stuff from the histogram - but I just want to know how long the last...