Package com.codahale.metrics.annotation
Annotation Type CachedGauge
-
@Retention(RUNTIME) @Target({METHOD,ANNOTATION_TYPE}) public @interface CachedGauge
An annotation for marking a method as a gauge, which caches the result for a specified time.Given a method like this:
@CachedGauge(name = "queueSize", timeout = 30, timeoutUnit = TimeUnit.SECONDS) public int getQueueSize() { return queue.getSize(); }
A gauge for the defining class with the name queueSize will be created which uses the annotated method's return value as its value, and which caches the result for 30 seconds.
- Since:
- 3.1