Class NoopLongTaskTimer
java.lang.Object
io.micrometer.core.instrument.AbstractMeter
io.micrometer.core.instrument.noop.NoopMeter
io.micrometer.core.instrument.noop.NoopLongTaskTimer
- All Implemented Interfaces:
LongTaskTimer,Meter
public class NoopLongTaskTimer extends NoopMeter implements LongTaskTimer
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.core.instrument.LongTaskTimer
LongTaskTimer.Builder, LongTaskTimer.SampleNested classes/interfaces inherited from interface io.micrometer.core.instrument.Meter
Meter.Builder, Meter.Id, Meter.Type -
Constructor Summary
Constructors Constructor Description NoopLongTaskTimer(Meter.Id id) -
Method Summary
Modifier and Type Method Description intactiveTasks()doubleduration(long task, java.util.concurrent.TimeUnit unit)The current duration for an active task.doubleduration(java.util.concurrent.TimeUnit unit)LongTaskTimer.Samplestart()Start keeping time for a task.longstop(long task)Mark a given task as completed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micrometer.core.instrument.LongTaskTimer
measure, record, record, record, recordCallable
-
Constructor Details
-
Method Details
-
start
Description copied from interface:LongTaskTimerStart keeping time for a task.- Specified by:
startin interfaceLongTaskTimer- Returns:
- A task id that can be used to look up how long the task has been running.
-
stop
public long stop(long task)Description copied from interface:LongTaskTimerMark a given task as completed.- Specified by:
stopin interfaceLongTaskTimer- Parameters:
task- Id for the task to stop. This should be the value returned fromLongTaskTimer.start().- Returns:
- Duration for the task in nanoseconds. A -1 value will be returned for an unknown task.
-
duration
public double duration(long task, java.util.concurrent.TimeUnit unit)Description copied from interface:LongTaskTimerThe current duration for an active task.- Specified by:
durationin interfaceLongTaskTimer- Parameters:
task- Id for the task to stop. This should be the value returned fromLongTaskTimer.start().unit- The time unit to scale the duration to.- Returns:
- Duration for the task. A -1 value will be returned for an unknown task.
-
duration
public double duration(java.util.concurrent.TimeUnit unit)- Specified by:
durationin interfaceLongTaskTimer- Parameters:
unit- The time unit to scale the duration to.- Returns:
- The cumulative duration of all current tasks.
-
activeTasks
public int activeTasks()- Specified by:
activeTasksin interfaceLongTaskTimer- Returns:
- The current number of tasks being executed.
-