public class DurationTimer extends AbstractMonitor<java.lang.Long> implements CompositeMonitor<java.lang.Long>
BasicTimer
instead.
This monitor will create two gauges:
config
Constructor and Description |
---|
DurationTimer(MonitorConfig config)
Create a new DurationTimer using the provided configuration.
|
DurationTimer(MonitorConfig config,
Clock clock)
Create a new DurationTimer using a specific configuration and clock.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<Monitor<?>> |
getMonitors()
Returns a list of sub-monitors for this composite.
|
java.lang.Long |
getValue()
Returns the current value for the monitor for the default polling interval.
|
java.lang.Long |
getValue(int pollerIndex)
Returns the current value for the monitor for the nth poller.
|
int |
hashCode() |
Stopwatch |
start()
Returns a stopwatch that has been started and will automatically
record its result to this timer when stopped.
|
java.lang.String |
toString() |
getConfig
public DurationTimer(MonitorConfig config)
public DurationTimer(MonitorConfig config, Clock clock)
public java.lang.Long getValue()
getValue
in interface Monitor<java.lang.Long>
getValue
in class AbstractMonitor<java.lang.Long>
public java.lang.Long getValue(int pollerIndex)
Monitor
public java.util.List<Monitor<?>> getMonitors()
getMonitors
in interface CompositeMonitor<java.lang.Long>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Stopwatch start()