ray.util.metrics.Counter#

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

Bases: Metric

A cumulative metric that is monotonically increasing.

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

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

inc

Increment the counter by value (defaults to 1).

set_default_tags

Set default tags of metrics.

Attributes

info

Return the information of this metric.