Package co.elastic.apm.agent.metrics
Class Timer
- java.lang.Object
-
- co.elastic.apm.agent.metrics.Timer
-
- All Implemented Interfaces:
Recyclable
public class Timer extends java.lang.Object implements Recyclable
This timer track the total time and the count of invocations so that it allows for calculating weighted averages.
-
-
Constructor Summary
Constructors Constructor Description Timer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCount()doublegetTotalTimeMs()longgetTotalTimeUs()booleanhasContent()voidresetState()resets pooled object state so it can be reusedvoidupdate(long durationUs)voidupdate(long durationUs, long count)
-
-
-
Method Detail
-
update
public void update(long durationUs)
-
update
public void update(long durationUs, long count)
-
getTotalTimeUs
public long getTotalTimeUs()
-
getTotalTimeMs
public double getTotalTimeMs()
-
getCount
public long getCount()
-
hasContent
public boolean hasContent()
-
resetState
public void resetState()
Description copied from interface:Recyclableresets pooled object state so it can be reused- Specified by:
resetStatein interfaceRecyclable
-
-