nl_tokens: Get an array of values for all buckets in the rolling counter for the given { @link NumerusRollingNumberEvent } type . <p > Index 0 is the oldest bucket . <p > The { @link NumerusRollingNumberEvent } must be a counter type <code > HystrixRollingNumberEvent . isCounter () == true< / code > .
pl_tokens: public long [ ] getValues ( NumerusRollingNumberEvent type ) { Bucket lastBucket = getCurrentBucket ( ) ; if ( lastBucket == null ) return new long [ 0 ] ; // get buckets as an array (which is a copy of the current state at this point in time) Bucket [ ] bucketArray = buckets . getArray ( ) ; // we have bucket data so we'll return an array of values for all buckets long values [ ] = new long [ bucketArray . length ] ; int i = 0 ; for ( Bucket bucket : bucketArray ) { if ( type . isCounter ( ) ) { values [ i ++ ] = bucket . getAdder ( type ) . sum ( ) ; } else if ( type . isMaxUpdater ( ) ) { values [ i ++ ] = bucket . getMaxUpdater ( type ) . <mask> ( ) ; } } return values ; }