return new TimingImpl( histogram.lastKey(), TimeUnit.NANOSECONDS );
}
BigInteger centileCount = centile.divide( _100, mc ).multiply( new BigDecimal( getCount() ) ).setScale( 0, RoundingMode.HALF_UP ).
toBigIntegerExact();
for ( Map.Entry<BigDecimal, BigInteger> histogramBucket : histogram.entrySet() ) {
centileCount = centileCount.subtract( histogramBucket.getValue() );
if ( centileCount.compareTo( BigInteger.ZERO ) <= 0 ) {
return new TimingImpl( histogramBucket.getKey(), TimeUnit.NANOSECONDS );
}
}
throw new IllegalStateException( "Could not find centile!" );