Package io.prometheus.client
Class Summary.Timer
java.lang.Object
io.prometheus.client.Summary.Timer
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
Summary
Represents an event being timed.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Equivalent to callingobserveDuration()
.double
Observe the amount of time in seconds sinceSummary.Child.startTimer()
was called.
-
Field Details
-
child
-
start
private final long start
-
-
Constructor Details
-
Timer
-
-
Method Details
-
observeDuration
public double observeDuration()Observe the amount of time in seconds sinceSummary.Child.startTimer()
was called.- Returns:
- Measured duration in seconds since
Summary.Child.startTimer()
was called.
-
close
public void close()Equivalent to callingobserveDuration()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-