Package io.prometheus.client
Class Histogram.Timer
- java.lang.Object
-
- io.prometheus.client.Histogram.Timer
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- Histogram
public static class Histogram.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 sinceHistogram.Child.startTimer()
was called.double
observeDurationWithExemplar(String... exemplarLabels)
double
observeDurationWithExemplar(Map<String,String> exemplarLabels)
-
-
-
Method Detail
-
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
public double observeDurationWithExemplar(String... exemplarLabels)
-
observeDurationWithExemplar
public double observeDurationWithExemplar(Map<String,String> exemplarLabels)
-
close
public void close()
Equivalent to callingobserveDuration()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-