def test_timing_bundle(self): timing_stat = timing.TimingStat(3, 20, 10, 15.0, 50.0, histogram.Histogram(10, 15, 20)) stats.add_timing("test", timing_stat) stats.add_timing("test", 25) test = stats.get_timing_stats(reset=False)["test"] self.assertEqual(4, test.count) self.assertEqual(17, test.average) self.assertEqual(6, int(test.std_dev)) stats.clear_all() timing_stat1 = timing.TimingStat(2, 25, 15, 20.0, 50.0, histogram.Histogram(15, 25)) timing_stat2 = timing.TimingStat(2, 20, 10, 15.0, 50.0, histogram.Histogram(10, 20)) stats.add_timing("test", timing_stat1) stats.add_timing("test", timing_stat2) test = stats.get_timing_stats(reset=False)["test"] self.assertEqual(4, test.count) self.assertEqual(17, test.average) self.assertEqual(6, int(test.std_dev))
def setUp(self): stats.clear_all() self.collector = TimeSeriesCollector()
def setUp(self): stats.clear_all()