percentile

Estimates the value at quantile p (0.0 to 1.0) as the UPPER BOUND of the bucket that holds it. Because buckets double in width, the estimate can be up to 2x the real value, but it never exceeds max, the largest value recorded. When the quantile falls in the overflow bucket the exact max is returned instead. An empty histogram returns Duration.ZERO.

Example:

val median = snapshot.percentile(0.5)

Return

the upper bound of the bucket containing the quantile (capped at max), max for the overflow bucket, or Duration.ZERO when count is zero.

Parameters

p

quantile to estimate, between 0.0 and 1.0 inclusive.

Throws

if p is not within 0.0..1.0.