public void receiveTiming(InetAddress host, long latency) // this is cheap
{
lastReceived.put(host, System.nanoTime());
ExponentiallyDecayingSample sample = samples.get(host);
if (sample == null)
{
ExponentiallyDecayingSample maybeNewSample = new ExponentiallyDecayingSample(WINDOW_SIZE, ALPHA);
sample = samples.putIfAbsent(host, maybeNewSample);
if (sample == null)
sample = maybeNewSample;
}
sample.update(latency);