public class UniformSnapshot extends Snapshot
UniformSnapshot.| Modifier | Constructor and Description |
|---|---|
|
UniformSnapshot(Collection<Long> values)
Create a new
Snapshot with the given values. |
|
UniformSnapshot(long[] values)
Create a new
Snapshot with the given values. |
protected |
UniformSnapshot(long[] values,
boolean copy)
Create a new
Snapshot with the given values. |
| Modifier and Type | Method and Description |
|---|---|
void |
dump(OutputStream output)
Writes the values of the snapshot to the given stream.
|
long |
getMax()
Returns the highest value in the snapshot.
|
double |
getMean()
Returns the arithmetic mean of the values in the snapshot.
|
long |
getMin()
Returns the lowest value in the snapshot.
|
double |
getStdDev()
Returns the standard deviation of the values in the snapshot.
|
double |
getValue(double quantile)
Returns the value at the given quantile.
|
long[] |
getValues()
Returns the entire set of values in the snapshot.
|
int |
size()
Returns the number of values in the snapshot.
|
get75thPercentile, get95thPercentile, get98thPercentile, get999thPercentile, get99thPercentile, getMedianpublic UniformSnapshot(Collection<Long> values)
Snapshot with the given values.values - an unordered set of values in the reservoirpublic UniformSnapshot(long[] values)
Snapshot with the given values.values - an unordered set of values in the reservoirprotected UniformSnapshot(long[] values,
boolean copy)
Snapshot with the given values.
Allows for trusted code to provide an array that won't be copied, for performance reasons.values - an unordered set of values in the reservoircopy - whether the array should be copied by the constructorpublic double getValue(double quantile)
public int size()
public long[] getValues()
public long getMax()
public long getMin()
public double getMean()
public double getStdDev()
public void dump(OutputStream output)
Copyright © 2021. All rights reserved.