Ejemplo n.º 1
0
    def _get_or_start_metric_exporter(self, metric_exporter_class):
        """Get the metric exporter belonging to this serve cluster.

        If the metric exporter does not already exist, it will be started.
        """
        try:
            self.metric_exporter = ray.util.get_actor(SERVE_METRIC_SINK_NAME)
        except ValueError:
            logger.info("Starting metric exporter with name '{}'".format(
                SERVE_METRIC_SINK_NAME))
            self.metric_exporter = MetricExporterActor.options(
                detached=True,
                name=SERVE_METRIC_SINK_NAME).remote(metric_exporter_class)
Ejemplo n.º 2
0
    def _get_or_start_metric_exporter(self, metric_exporter_class):
        """Get the metric exporter belonging to this serve instance.

        If the metric exporter does not already exist, it will be started.
        """
        metric_sink_name = format_actor_name(SERVE_METRIC_SINK_NAME,
                                             self.instance_name)
        try:
            self.metric_exporter = ray.get_actor(metric_sink_name)
        except ValueError:
            logger.info("Starting metric exporter with name '{}'".format(
                metric_sink_name))
            self.metric_exporter = MetricExporterActor.options(
                name=metric_sink_name).remote(metric_exporter_class)