Class ThreadBarrier.BarrierTimer
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.ThreadBarrier.BarrierTimer
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- ThreadBarrier
public static class ThreadBarrier.BarrierTimer extends java.lang.Object implements java.lang.RunnableA Barrier action to be used in conjunction withThreadBarrierto measure performance between barrier awaits. This runnable will execute when the barrier is tripped. Make sure to reset() the timer before next Measurement.
-
-
Constructor Summary
Constructors Constructor Description BarrierTimer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetTimeInNanos()Returns the elapsed time between two successive barrier executions.doublegetTimeInSeconds()Returns the elapsed time between two successive barrier executions.voidreset()resets (clears) this timer before next execution.voidrun()
-
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
reset
public void reset()
resets (clears) this timer before next execution.
-
getTimeInNanos
public long getTimeInNanos()
Returns the elapsed time between two successive barrier executions.- Returns:
- elapsed time in nanoseconds.
-
getTimeInSeconds
public double getTimeInSeconds()
Returns the elapsed time between two successive barrier executions.- Returns:
- elapsed time in seconds.
-
-