Beispiel #1
0
    def init_or_get_metric_monitor(self, gc_window_seconds=3600):
        if "metric_monitor" not in self.actor_handle_cache:
            [handle] = ray.get(
                self.actor_nursery_handle.start_actor.remote(
                    MetricMonitor,
                    init_args=(gc_window_seconds, ),
                    tag="metric_monitor"))

            start_metric_monitor_loop.remote(handle)

            if "queue_actor" in self.actor_handle_cache:
                handle.add_target.remote(
                    self.actor_handle_cache["queue_actor"])

            self.refresh_actor_handle_cache()

        return self.actor_handle_cache["metric_monitor"]
Beispiel #2
0
 def init_metric_monitor(self, gc_window_seconds=3600):
     logger.info(LOG_PREFIX + "Initializing metric monitor")
     self.metric_monitor_handle = MetricMonitor.remote(gc_window_seconds)
     start_metric_monitor_loop.remote(self.metric_monitor_handle)
     self.metric_monitor_handle.add_target.remote(self.router_actor_handle)