com.netflix.servo.monitor
Class MinGauge

java.lang.Object
  extended by com.netflix.servo.monitor.AbstractMonitor<java.lang.Long>
      extended by com.netflix.servo.monitor.MinGauge
All Implemented Interfaces:
Gauge<java.lang.Long>, Monitor<java.lang.Long>, NumericMonitor<java.lang.Long>, ResettableMonitor<java.lang.Long>

public class MinGauge
extends AbstractMonitor<java.lang.Long>
implements Gauge<java.lang.Long>, ResettableMonitor<java.lang.Long>

Gauge that keeps track of the minimum value seen since the last reset. The reset value is Long.MAX_VALUE. If no update has been received since the last reset, then getValue() will return 0.


Field Summary
 
Fields inherited from class com.netflix.servo.monitor.AbstractMonitor
config
 
Constructor Summary
MinGauge(MonitorConfig config)
          Creates a new instance of the gauge.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 java.lang.Long getAndResetValue()
          Return the value and reset the monitor state for the default polling interval.
 java.lang.Long getAndResetValue(int pollerIdx)
          Return the value and reset the monitor state for a given polling interval.
 java.lang.Long getValue()
          Returns the current value for the monitor.
 int hashCode()
          
 java.lang.String toString()
          
 void update(long v)
          Update the min if the provided value is smaller than the current min.
 
Methods inherited from class com.netflix.servo.monitor.AbstractMonitor
getConfig
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.netflix.servo.monitor.Monitor
getConfig
 

Constructor Detail

MinGauge

public MinGauge(MonitorConfig config)
Creates a new instance of the gauge.

Method Detail

update

public void update(long v)
Update the min if the provided value is smaller than the current min.


getValue

public java.lang.Long getValue()
Returns the current value for the monitor.

Specified by:
getValue in interface Monitor<java.lang.Long>

getAndResetValue

public java.lang.Long getAndResetValue()
Return the value and reset the monitor state for the default polling interval.

Specified by:
getAndResetValue in interface ResettableMonitor<java.lang.Long>

getAndResetValue

public java.lang.Long getAndResetValue(int pollerIdx)
Description copied from interface: ResettableMonitor
Return the value and reset the monitor state for a given polling interval. This allows us to support multiple pollers, for example a 10second and 60second poller.

Specified by:
getAndResetValue in interface ResettableMonitor<java.lang.Long>

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