src/java/org/apache/cassandra/utils/EstimatedHistogram.java
/**
     * @return the mean histogram value (average of bucket offsets, weighted by count)
     * @throws IllegalStateException if any values were greater than the largest bucket threshold
     */
@return the mean histogram value (average of bucket offsets, weighted by count)
@throws IllegalStateException if any values were greater than the largest bucket threshold
@return the mean histogram value ( average of bucket offsets weighted by count ) @throws IllegalStateException if any values were greater than the largest bucket threshold
public long mean()
    {
        int lastBucket = buckets.length() - 1;
        if (buckets.get(lastBucket) > 0)
            throw new IllegalStateException("Unable to compute ceiling for max when histogram overflowed");
        long elements = 0;
        long sum = 0;
        for (int i = 0; i < lastBucket; i++)
        {
            elements += buckets.get(i);
            sum += buckets.get(i) * bucketOffsets[i];
        }
        return (long) Math.ceil((double) sum / elements);
    }
public long mean ( ) { int lastBucket = buckets . length ( ) - 1 ; if ( buckets . get ( lastBucket ) > 0 ) throw new IllegalStateException ( "Unable to compute ceiling for max when histogram overflowed" ) ; long elements = 0 ; long sum = 0 ; for ( int i = 0 ; i < lastBucket ; i ++ ) { elements += buckets . get ( i ) ; sum += buckets . get ( i ) * bucketOffsets [ i ] ; } return ( long ) Math . ceil ( ( double ) sum / elements ) ; }
@return the mean histogram value (average of bucket offsets, weighted by count)
 @throws IllegalStateException if any values were greater than the largest bucket threshold
@return the mean histogram value ( average of bucket offsets weighted by count ) @throws IllegalStateException if any values were greater than the largest bucket threshold