Exemplo n.º 1
0
 def test_clear(self):
     histogram = HistogramExponentiallyDecaying()
     histogram.clear()
     histogram.update(5)
     histogram.update(15)
     self.assertEqual(5, histogram.min)
     self.assertEqual(15, histogram.max)
Exemplo n.º 2
0
 def test_clear(self):
     histogram = HistogramExponentiallyDecaying()
     histogram.clear()
     histogram.update(5)
     histogram.update(15)
     self.assertEqual(5, histogram.min)
     self.assertEqual(15, histogram.max)
Exemplo n.º 3
0
 def test_exponential_sample_2000(self):
     histogram = HistogramExponentiallyDecaying()
     for i in range(2000):
         histogram.update(i)
     self.assertEqual(1999, histogram.max)
Exemplo n.º 4
0
 def test_exponential_sample_mean(self):
     histogram = HistogramExponentiallyDecaying()
     histogram.update(5)
     histogram.update(10)
     self.assertEqual(7.5, histogram.mean)
Exemplo n.º 5
0
 def test_exponential_sample_snapshot(self):
     histogram = HistogramExponentiallyDecaying()
     for i in range(100):
         histogram.update(i)
     snapshot = histogram.snapshot
     self.assertEqual(49.5, snapshot.median)
Exemplo n.º 6
0
 def test_exponential_sample_2000(self):
     histogram = HistogramExponentiallyDecaying()
     for i in range(2000):
         histogram.update(i)
     self.assertEqual(1999, histogram.max)
Exemplo n.º 7
0
 def test_exponential_sample_mean(self):
     histogram = HistogramExponentiallyDecaying()
     histogram.update(5)
     histogram.update(10)
     self.assertEqual(7.5, histogram.mean)
Exemplo n.º 8
0
 def test_exponential_sample_snapshot(self):
     histogram = HistogramExponentiallyDecaying()
     for i in range(100):
         histogram.update(i)
     snapshot = histogram.snapshot
     self.assertEqual(49.5, snapshot.median)