Ejemplo n.º 1
0
  def start(self):
    context = self.pplan_helper.context
    self.spout_metrics.register_metrics(context)
    self.spout_impl.initialize(config=context.get_cluster_config(), context=context)
    context.invoke_hook_prepare()

    # prepare global metrics
    interval = float(self.sys_config[constants.HERON_METRICS_EXPORT_INTERVAL_SEC])
    collector = context.get_metrics_collector()
    global_metrics.init(collector, interval)

    # prepare for custom grouping
    self.pplan_helper.prepare_custom_grouping(context)

    self._add_spout_task()
    self.topology_state = topology_pb2.TopologyState.Value("RUNNING")
Ejemplo n.º 2
0
  def start(self):
    context = self.pplan_helper.context
    self.bolt_metrics.register_metrics(context)
    self.bolt_impl.initialize(config=context.get_cluster_config(), context=context)
    context.invoke_hook_prepare()

    # prepare global metrics
    interval = float(self.sys_config[constants.HERON_METRICS_EXPORT_INTERVAL_SEC])
    collector = context.get_metrics_collector()
    global_metrics.init(collector, interval)

    # prepare for custom grouping
    self.pplan_helper.prepare_custom_grouping(context)

    # prepare tick tuple
    self._prepare_tick_tup_timer()
Ejemplo n.º 3
0
 def setUp(self):
   self.metrics_collector = mock_generator.MockMetricsCollector()
   global_metrics.init(self.metrics_collector, 10)
   self.lock = threading.Lock()