Exemple #1
0
 def send_tick():
   tick = TupleHelper.make_tick_tuple()
   start_time = time.time()
   self.bolt_impl.process_tick(tick)
   tick_execute_latency_ns = (time.time() - start_time) * system_constants.SEC_TO_NS
   self.bolt_metrics.execute_tuple(tick.id, tick.component, tick_execute_latency_ns)
   self.output_helper.send_out_tuples()
   self.looper.wake_up() # so emitted tuples would be added to buffer now
   self._prepare_tick_tup_timer()
Exemple #2
0
 def send_tick():
   tick = TupleHelper.make_tick_tuple()
   start_time = time.time()
   self.bolt_impl.process_tick(tick)
   tick_execute_latency_ns = (time.time() - start_time) * system_constants.SEC_TO_NS
   self.bolt_metrics.execute_tuple(tick.id, tick.component, tick_execute_latency_ns)
   self.output_helper.send_out_tuples()
   self.looper.wake_up() # so emitted tuples would be added to buffer now
   self._prepare_tick_tup_timer()
 def test_tick_tuple(self):
   tup = TupleHelper.make_tick_tuple()
   self.assertEqual(tup.id, "__tick")
   self.assertEqual(tup.component, "__system")
   self.assertEqual(tup.stream, "__tick")
   self.assertIsNone(tup.task)
   self.assertIsNone(tup.values)
   self.assertIsNone(tup.roots)
   self.assertAlmostEqual(tup.creation_time, time.time(), delta=0.01)
Exemple #4
0
 def test_tick_tuple(self):
     tup = TupleHelper.make_tick_tuple()
     self.assertEqual(tup.id, "__tick")
     self.assertEqual(tup.component, "__system")
     self.assertEqual(tup.stream, "__tick")
     self.assertIsNone(tup.task)
     self.assertIsNone(tup.values)
     self.assertIsNone(tup.roots)
     self.assertAlmostEqual(tup.creation_time, time.time(), delta=0.01)