public class UnsafeButFasterUniformReservoir
extends java.lang.Object
implements com.codahale.metrics.Reservoir
longs. Uses Vitter's Algorithm R to produce a
statistically representative sample.| Constructor and Description |
|---|
UnsafeButFasterUniformReservoir()
Creates a new
UniformReservoir of 1028 elements, which offers a 99.9% confidence level
with a 5% margin of error assuming a normal distribution. |
UnsafeButFasterUniformReservoir(int size)
Creates a new
UniformReservoir. |
| Modifier and Type | Method and Description |
|---|---|
com.codahale.metrics.Snapshot |
getSnapshot() |
int |
size() |
void |
update(long value) |
public UnsafeButFasterUniformReservoir()
UniformReservoir of 1028 elements, which offers a 99.9% confidence level
with a 5% margin of error assuming a normal distribution.public UnsafeButFasterUniformReservoir(int size)
UniformReservoir.size - the number of samples to keep in the sampling reservoirpublic int size()
size in interface com.codahale.metrics.Reservoirpublic void update(long value)
update in interface com.codahale.metrics.Reservoirpublic com.codahale.metrics.Snapshot getSnapshot()
getSnapshot in interface com.codahale.metrics.Reservoir