Package com.codahale.metrics
Class CachedGauge<T>
- java.lang.Object
-
- com.codahale.metrics.CachedGauge<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
getValue()
Returns the metric's current value.protected abstract T
loadValue()
Loads the value and returns it.
-
-
-
Constructor Detail
-
CachedGauge
protected CachedGauge(long timeout, TimeUnit timeoutUnit)
Creates a new cached gauge with the given timeout period.- Parameters:
timeout
- the timeouttimeoutUnit
- the unit oftimeout
-
-