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