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