Class Distribution (2.18.1)

public class Distribution

Distribution records values from 0 (inclusive) to endValue (exclusive) and computes their percentiles.

Methods may be called concurrently.

Inheritance

java.lang.Object > Distribution

Constructors

Distribution(int endValue)

public Distribution(int endValue)
Parameter
NameDescription
endValueint

Methods

getNthPercentile(double percentile)

public long getNthPercentile(double percentile)
Parameter
NameDescription
percentiledouble
Returns
TypeDescription
long

getPercentile(double percentile)

public int getPercentile(double percentile)

Get the percentile of recorded values. If called concurrently with #record(int), the result is an approximate.

Parameter
NameDescription
percentiledouble
Returns
TypeDescription
int

record(int value)

public void record(int value)

Records a new value.

The value must not be negative. To help with distributions with long tails, if the given value is greater than or equal to endValue, the value endValue-1 is recorded instead.

Parameter
NameDescription
valueint

toString()

public String toString()
Returns
TypeDescription
String
Overrides