Package com.codahale.metrics
Class CachedGauge<T>
java.lang.Object
com.codahale.metrics.CachedGauge<T>
- Type Parameters:
T
- the type of the gauge's value
A
Gauge
implementation which caches its value for a period of time.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CachedGauge
(long timeout, TimeUnit timeoutUnit) Creates a new cached gauge with the given timeout period.protected
CachedGauge
(Clock clock, long timeout, TimeUnit timeoutUnit) Creates a new cached gauge with the given clock and timeout period. -
Method Summary
-
Field Details
-
clock
-
reloadAt
-
timeoutNS
private final long timeoutNS -
value
-
-
Constructor Details
-
CachedGauge
Creates a new cached gauge with the given timeout period.- Parameters:
timeout
- the timeouttimeoutUnit
- the unit oftimeout
-
CachedGauge
Creates a new cached gauge with the given clock and timeout period.- Parameters:
clock
- the clock used to calculate the timeouttimeout
- the timeouttimeoutUnit
- the unit oftimeout
-
-
Method Details