org.smallmind.instrument
Class ExponentiallyDecayingSample
java.lang.Object
org.smallmind.instrument.ExponentiallyDecayingSample
- All Implemented Interfaces:
- Sample, Shutterbug
public class ExponentiallyDecayingSample
- extends Object
- implements Sample
Uses Cormode et al's forward-decayiny priority reservoir sampling method to produce a statistically
representative sample, exponentially biased towards newer entries.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExponentiallyDecayingSample
public ExponentiallyDecayingSample(int reservoirSize,
double alpha)
ExponentiallyDecayingSample
public ExponentiallyDecayingSample(int reservoirSize,
double alpha,
Clock clock)
getType
public Samples getType()
- Specified by:
getType in interface Sample
clear
public void clear()
- Specified by:
clear in interface Sample
size
public int size()
- Specified by:
size in interface Sample
update
public void update(long value)
- Specified by:
update in interface Sample
getSnapshot
public Snapshot getSnapshot()
- Specified by:
getSnapshot in interface Shutterbug
Copyright © 2012. All Rights Reserved.