Package io.prometheus.client
Class Summary.Timer
- java.lang.Object
-
- io.prometheus.client.Summary.Timer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- Summary
public static class Summary.Timer extends java.lang.Object implements java.io.CloseableRepresents an event being timed.
-
-
Field Summary
Fields Modifier and Type Field Description private Summary.Childchildprivate longstart
-
Constructor Summary
Constructors Modifier Constructor Description privateTimer(Summary.Child child, long start)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Equivalent to callingobserveDuration().doubleobserveDuration()Observe the amount of time in seconds sinceSummary.Child.startTimer()was called.
-
-
-
Field Detail
-
child
private final Summary.Child child
-
start
private final long start
-
-
Constructor Detail
-
Timer
private Timer(Summary.Child child, long start)
-
-
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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-