コード例 #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)
コード例 #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)
コード例 #3
0
 def test_exponential_sample_2000(self):
     histogram = HistogramExponentiallyDecaying()
     for i in range(2000):
         histogram.update(i)
     self.assertEqual(1999, histogram.max)
コード例 #4
0
 def test_exponential_sample_mean(self):
     histogram = HistogramExponentiallyDecaying()
     histogram.update(5)
     histogram.update(10)
     self.assertEqual(7.5, histogram.mean)
コード例 #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)
コード例 #6
0
 def test_exponential_sample_2000(self):
     histogram = HistogramExponentiallyDecaying()
     for i in range(2000):
         histogram.update(i)
     self.assertEqual(1999, histogram.max)
コード例 #7
0
 def test_exponential_sample_mean(self):
     histogram = HistogramExponentiallyDecaying()
     histogram.update(5)
     histogram.update(10)
     self.assertEqual(7.5, histogram.mean)
コード例 #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)