Exemplo n.º 1
0
  def start(self, stateful_state):
    self._stateful_state = stateful_state
    self.start_component(stateful_state)
    context = self.pplan_helper.context
    context.invoke_hook_prepare()

    # prepare global metrics
    if not self._initialized_global_metrics:
      interval = float(self.sys_config[system_constants.HERON_METRICS_EXPORT_INTERVAL_SEC])
      collector = context.get_metrics_collector()
      global_metrics.init(collector, interval)
      self._initialized_global_metrics = True

    # prepare for custom grouping
    self.pplan_helper.prepare_custom_grouping(context)
Exemplo n.º 2
0
  def start(self, stateful_state):
    self._stateful_state = stateful_state
    self.start_component(stateful_state)
    context = self.pplan_helper.context
    context.invoke_hook_prepare()

    # prepare global metrics
    if not self._initialized_global_metrics:
      interval = float(self.sys_config[system_constants.HERON_METRICS_EXPORT_INTERVAL_SEC])
      collector = context.get_metrics_collector()
      global_metrics.init(collector, interval)
      self._initialized_global_metrics = True

    # prepare for custom grouping
    self.pplan_helper.prepare_custom_grouping(context)
Exemplo n.º 3
0
 def setUp(self):
     self.metrics_collector = mock_generator.MockMetricsCollector()
     global_metrics.init(self.metrics_collector, 10)
     self.lock = threading.Lock()
Exemplo n.º 4
0
 def setUp(self):
   self.metrics_collector = mock_generator.MockMetricsCollector()
   global_metrics.init(self.metrics_collector, 10)
   self.lock = threading.Lock()