public class UniformSample extends Object implements Sample
longs. Uses Vitter's Algorithm R to produce a
statistically representative sample.| Constructor and Description |
|---|
UniformSample(int reservoirSize)
Creates a new
UniformSample. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all recorded values.
|
Snapshot |
getSnapshot()
Returns a snapshot of the sample's values.
|
int |
size()
Returns the number of values recorded.
|
void |
update(long value)
Adds a new recorded value to the sample.
|
public UniformSample(int reservoirSize)
UniformSample.reservoirSize - the number of samples to keep in the sampling reservoirpublic void clear()
Samplepublic int size()
Samplepublic void update(long value)
Samplepublic Snapshot getSnapshot()
SamplegetSnapshot in interface SampleCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.