int getAveReduceSlotRefillMsecs ( ) { synchronized ( reduceSlotRefillMsecsQueue ) { if ( reduceSlotRefillMsecsQueue . isEmpty ( ) ) { return - 1 ; } int totalReduceSlotRefillMsecs = 0 ; for ( int refillMsecs : reduceSlotRefillMsecsQueue ) { totalReduceSlotRefillMsecs += refillMsecs ; } return totalReduceSlotRefillMsecs / reduceSlotRefillMsecsQueue . size ( ) ; } }
Get the average time in milliseconds to refill a free reduce slot . This average is calculated on a rotating buffer .