public class Distribution
Distribution records values from 0
(inclusive) to endValue
(exclusive) and
computes their percentiles.
Methods may be called concurrently.
Constructors
Distribution(int endValue)
public Distribution(int endValue)
Parameter | |
---|---|
Name | Description |
endValue | int |
Methods
getNthPercentile(double percentile)
public long getNthPercentile(double percentile)
Parameter | |
---|---|
Name | Description |
percentile | double |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
percentile | double |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value | int |
toString()
public String toString()
Returns | |
---|---|
Type | Description |
String |