Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Adds an old value with a fixed timestamp to the reservoir.
@param value     the value to be added

src/s/c/scales-1.0.6/src/greplin/scales/samplestats_test.py   scales(Download)
    sample = ExponentiallyDecayingReservoir()
    for _ in range(300):
      sample.update(random.gauss(42.0, 13.0))
    self.assertAlmostEqual(sample.mean, 41.974069434931714, places=5)
    self.assertAlmostEqual(sample.stddev, 12.982363860393766, places=5)
 
    sample = ExponentiallyDecayingReservoir(rescale_threshold=-1)
    sample.update(random.gauss(42.0, 13.0))
    self.assertAlmostEqual(sample.mean, 40.12682571548693, places=5)
 

src/s/c/scales-HEAD/src/greplin/scales/samplestats_test.py   scales(Download)
    sample = ExponentiallyDecayingReservoir()
    for _ in range(300):
      sample.update(random.gauss(42.0, 13.0))
    self.assertAlmostEqual(sample.mean, 41.974069434931714, places=5)
    self.assertAlmostEqual(sample.stddev, 12.982363860393766, places=5)
 
    sample = ExponentiallyDecayingReservoir(rescale_threshold=-1)
    sample.update(random.gauss(42.0, 13.0))
    self.assertAlmostEqual(sample.mean, 40.12682571548693, places=5)