com.netflix.servo.monitor
Class BasicGauge<T extends java.lang.Number>
java.lang.Object
com.netflix.servo.monitor.AbstractMonitor<T>
com.netflix.servo.monitor.BasicGauge<T>
- All Implemented Interfaces:
- Gauge<T>, Monitor<T>, NumericMonitor<T>
public final class BasicGauge<T extends java.lang.Number>
- extends AbstractMonitor<T>
- implements Gauge<T>
A gauge implementation that invokes a specified callable to get the current value.
|
Constructor Summary |
BasicGauge(MonitorConfig config,
java.util.concurrent.Callable<T> function)
Creates a new instance of the gauge. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
BasicGauge
public BasicGauge(MonitorConfig config,
java.util.concurrent.Callable<T> function)
- Creates a new instance of the gauge.
- Parameters:
config - configuration for this monitorfunction - a function used to fetch the value on demand
getValue
public T getValue()
- Returns the current value for the monitor.
- Specified by:
getValue in interface Monitor<T extends java.lang.Number>
equals
public boolean equals(java.lang.Object obj)
-
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
-
- Overrides:
hashCode in class java.lang.Object
toString
public java.lang.String toString()
-
- Overrides:
toString in class java.lang.Object