Class SimpleTimerImpl
- java.lang.Object
-
- fish.payara.microprofile.metrics.impl.SimpleTimerImpl
-
- All Implemented Interfaces:
org.eclipse.microprofile.metrics.Counting
,org.eclipse.microprofile.metrics.Metric
,org.eclipse.microprofile.metrics.SimpleTimer
@Vetoed public class SimpleTimerImpl extends Object implements org.eclipse.microprofile.metrics.SimpleTimer
A timer that aggregates timed durations and provides the total asgetElapsedTime()
and the number of updates asgetCount()
. Durations are measured in nanoseconds.- Since:
- 5.202
- Author:
- Jan Bernitt
-
-
Constructor Summary
Constructors Constructor Description SimpleTimerImpl(Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCount()
Duration
getElapsedTime()
Duration
getMaxTimeDuration()
Duration
getMinTimeDuration()
org.eclipse.microprofile.metrics.SimpleTimer.Context
time()
void
time(Runnable event)
<T> T
time(Callable<T> event)
String
toString()
void
update(Duration duration)
-
-
-
Field Detail
-
clock
protected final Clock clock
-
-
Constructor Detail
-
SimpleTimerImpl
public SimpleTimerImpl(Clock clock)
-
-
Method Detail
-
update
public void update(Duration duration)
- Specified by:
update
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
time
public <T> T time(Callable<T> event) throws Exception
- Specified by:
time
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
- Throws:
Exception
-
time
public void time(Runnable event)
- Specified by:
time
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
time
public org.eclipse.microprofile.metrics.SimpleTimer.Context time()
- Specified by:
time
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
getElapsedTime
public Duration getElapsedTime()
- Specified by:
getElapsedTime
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
getCount
public long getCount()
- Specified by:
getCount
in interfaceorg.eclipse.microprofile.metrics.Counting
- Specified by:
getCount
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
getMaxTimeDuration
public Duration getMaxTimeDuration()
- Specified by:
getMaxTimeDuration
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
getMinTimeDuration
public Duration getMinTimeDuration()
- Specified by:
getMinTimeDuration
in interfaceorg.eclipse.microprofile.metrics.SimpleTimer
-
-