float refreshAndGetAvg ( ) { long total = 0 ; ResultSubpartition [ ] allPartitions = partition . getAllPartitions ( ) ; for ( ResultSubpartition part : allPartitions ) { int size = part . unsynchronizedGetNumberOfQueuedBuffers ( ) ; total += size ; } return total / ( float ) allPartitions . length ; }
Iterates over all sub - partitions and collects the average number of queued buffers in a sub - partition in a best - effort way .