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.Sample
-
Nested 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
activeTasks()
double
duration(long task, java.util.concurrent.TimeUnit unit)
The current duration for an active task.double
duration(java.util.concurrent.TimeUnit unit)
LongTaskTimer.Sample
start()
Start keeping time for a task.long
stop(long task)
Mark a given task as completed.-
Methods inherited from class io.micrometer.core.instrument.AbstractMeter
getId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micrometer.core.instrument.LongTaskTimer
measure, record, record, record, recordCallable
-
-
-
-
Constructor Detail
-
NoopLongTaskTimer
public NoopLongTaskTimer(Meter.Id id)
-
-
Method Detail
-
start
public LongTaskTimer.Sample start()
Description copied from interface:LongTaskTimer
Start keeping time for a task.- Specified by:
start
in 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:LongTaskTimer
Mark a given task as completed.- Specified by:
stop
in 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:LongTaskTimer
The current duration for an active task.- Specified by:
duration
in 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:
duration
in 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:
activeTasks
in interfaceLongTaskTimer
- Returns:
- The current number of tasks being executed.
-
-