Package io.prometheus.client
Class Summary.Timer
- java.lang.Object
-
- io.prometheus.client.Summary.Timer
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- Summary
public static class Summary.Timer extends Object implements Closeable
Represents an event being timed.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Equivalent to callingobserveDuration()
.double
observeDuration()
Observe the amount of time in seconds sinceSummary.Child.startTimer()
was called.
-
-
-
Method Detail
-
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
-
-