Class ConcurrentTimeCounter

java.lang.Object
org.apache.druid.java.util.emitter.core.ConcurrentTimeCounter

public class ConcurrentTimeCounter extends Object
A class to accumulate simple stats of some time points. All methods are safe to use from multiple threads.
  • Constructor Details

    • ConcurrentTimeCounter

      public ConcurrentTimeCounter()
  • Method Details

    • add

      public void add(int time)
    • getTimeSumAndCountAndReset

      public long getTimeSumAndCountAndReset()
    • getAndResetMaxTime

      @Nullable public Integer getAndResetMaxTime()
      Returns the max time add(int)ed since the previous call to this method or since the creation of this object, or null if no times were added.
    • getAndResetMinTime

      @Nullable public Integer getAndResetMinTime()
      Returns the min time add(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)