def test_start_time_set(self): c = CounterCell() c.inc(2) name = MetricName('namespace', 'name1') mi = c.to_runner_api_monitoring_info(name, 'transform_id') self.assertGreater(mi.start_time.seconds, 0)
def test_basic_operations(self): c = CounterCell() c.inc(2) self.assertEqual(c.get_cumulative(), 2) c.dec(10) self.assertEqual(c.get_cumulative(), -8) c.dec() self.assertEqual(c.get_cumulative(), -9) c.inc() self.assertEqual(c.get_cumulative(), -8)
def test_basic_operations(self): c = CounterCell() c.inc(2) self.assertEqual(c.get_cumulative(), 2) c.dec(10) self.assertEqual(c.get_cumulative(), -8) c.dec() self.assertEqual(c.get_cumulative(), -9) c.inc() self.assertEqual(c.get_cumulative(), -8)