MetricCollector.percentile

T percentile(Duration window, double p)

Gets the percentile value within a time window.

Parameters

windowThe duration to look back from now.
pThe percentile to calculate (0-100).

Returns

The value at the specified percentile.

Throws

Exception if no data is in the window.

Example:

double p95 = collector.percentile(1.minute, 95.0);