|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.servo.monitor.AbstractContextualMonitor<java.lang.Long,Timer>
com.netflix.servo.monitor.ContextualTimer
public class ContextualTimer
Composite that maintains separate simple timers for each distinct set of tags returned by the tagging context.
| Field Summary |
|---|
| Fields inherited from class com.netflix.servo.monitor.AbstractContextualMonitor |
|---|
baseConfig, context, monitors, newMonitor |
| Constructor Summary | |
|---|---|
ContextualTimer(MonitorConfig config,
TaggingContext context,
com.google.common.base.Function<MonitorConfig,Timer> newMonitor)
Create a new instance of the timer. |
|
| Method Summary | |
|---|---|
java.util.concurrent.TimeUnit |
getTimeUnit()
The time unit reported by this timer. |
java.lang.Long |
getValue()
Returns the current value for the monitor. |
void |
record(long duration)
Record a new value for this timer. |
void |
record(long duration,
java.util.concurrent.TimeUnit timeUnit)
Record a new value that was collected with the given TimeUnit. |
Stopwatch |
start()
Returns a stopwatch that has been started and will automatically record its result to this timer when stopped. |
| Methods inherited from class com.netflix.servo.monitor.AbstractContextualMonitor |
|---|
getConfig, getMonitorForCurrentContext, getMonitors |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.netflix.servo.monitor.Monitor |
|---|
getConfig |
| Constructor Detail |
|---|
public ContextualTimer(MonitorConfig config,
TaggingContext context,
com.google.common.base.Function<MonitorConfig,Timer> newMonitor)
config - shared configurationcontext - provider for context specific tagsnewMonitor - function to create new timers| Method Detail |
|---|
public Stopwatch start()
start in interface Timerpublic java.util.concurrent.TimeUnit getTimeUnit()
getTimeUnit in interface Timerpublic void record(long duration)
record in interface Timer
public void record(long duration,
java.util.concurrent.TimeUnit timeUnit)
record in interface Timerpublic java.lang.Long getValue()
getValue in interface Monitor<java.lang.Long>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||