Class Timer
java.lang.Object
io.prometheus.metrics.core.datapoints.Timer
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Same asobserveDuration().doubleRecords the observed duration in seconds since thisTimerinstance was created.
-
Field Details
-
observeFunction
-
startTimeNanos
private final long startTimeNanos
-
-
Constructor Details
-
Timer
Timer(DoubleConsumer observeFunction)
-
-
Method Details
-
observeDuration
public double observeDuration()Records the observed duration in seconds since thisTimerinstance was created.- Returns:
- the observed duration in seconds.
-
close
public void close()Same asobserveDuration().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-