@Retention(value=RUNTIME) @Target(value=METHOD) public @interface CachedGauge
@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.public abstract String name
public abstract boolean absolute
true
, use the given name as an absolute name. If false
, use the given name
relative to the annotated class.public abstract TimeUnit timeoutUnit
Copyright © 2014. All Rights Reserved.