'Test binned timings.'

def testMaps(self):

    stats.STATS.RegisterEventMetric('test_timed', bins=[0.0, 0.1, 0.2])
    m = stats.STATS.GetMetricValue('test_timed')
    self.assertEqual(m.bins_heights[0.0], 0)
    self.assertEqual(m.bins_heights[0.1], 0)
    self.assertEqual(m.bins_heights[0.2], 0)
    for _ in range(3):
        self.TimedFunc(0)
    m = stats.STATS.GetMetricValue('test_timed')
    self.assertEqual(m.bins_heights[0.0], 3)
    self.assertEqual(m.bins_heights[0.1], 0)
    self.assertEqual(m.bins_heights[0.2], 0)
    self.TimedFunc(0.11)
    m = stats.STATS.GetMetricValue('test_timed')
    self.assertEqual(m.bins_heights[0.0], 3)
    self.assertEqual(m.bins_heights[0.1], 1)
    self.assertEqual(m.bins_heights[0.2], 0)
