ray.util.metrics.Gauge#

class ray.util.metrics.Gauge(name: str, description: str = '', tag_keys: Tuple[str, ...] | None = None)[source]#

Bases: Metric

Gauges keep the last recorded value and drop everything before.

Unlike counters, gauges can go up or down over time.

This corresponds to Prometheus’ gauge metric: https://prometheus.io/docs/concepts/metric_types/#gauge

Parameters:
  • name – Name of the metric.

  • description – Description of the metric.

  • tag_keys – Tag keys of the metric.

DeveloperAPI: This API may change across minor Ray releases.

Methods

record

Record the metric point of the metric.

set

Set the gauge to the given value.

set_default_tags

Set default tags of metrics.

Attributes

info

Return the information of this metric.