org.smallmind.instrument
Class ExponentiallyDecayingSample

java.lang.Object
  extended by 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.


Constructor Summary
ExponentiallyDecayingSample(int reservoirSize, double alpha)
           
ExponentiallyDecayingSample(int reservoirSize, double alpha, Clock clock)
           
 
Method Summary
 void clear()
           
 Snapshot getSnapshot()
           
 Samples getType()
           
 int size()
           
 void update(long value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExponentiallyDecayingSample

public ExponentiallyDecayingSample(int reservoirSize,
                                   double alpha)

ExponentiallyDecayingSample

public ExponentiallyDecayingSample(int reservoirSize,
                                   double alpha,
                                   Clock clock)
Method Detail

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.