Class ConcurrentTimeCounter
java.lang.Object
org.apache.druid.java.util.emitter.core.ConcurrentTimeCounter
A class to accumulate simple stats of some time points. All methods are safe to use from multiple threads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int time) static intcount(long timeSumAndCount) Returns the max timeadd(int)ed since the previous call to this method or since the creation of this object, or null if no times were added.Returns the min timeadd(int)ed since the previous call to this method or since the creation of this object, or null if no times were added.longstatic inttimeSum(long timeSumAndCount)
-
Constructor Details
-
ConcurrentTimeCounter
public ConcurrentTimeCounter()
-
-
Method Details
-
add
public void add(int time) -
getTimeSumAndCountAndReset
public long getTimeSumAndCountAndReset() -
getAndResetMaxTime
Returns the max timeadd(int)ed since the previous call to this method or since the creation of this object, or null if no times were added. -
getAndResetMinTime
Returns the min timeadd(int)ed since the previous call to this method or since the creation of this object, or null if no times were added. -
timeSum
public static int timeSum(long timeSumAndCount) -
count
public static int count(long timeSumAndCount)
-