ray.util.metrics.Counter#

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

Bases: ray.util.metrics.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([value, tags])

Increment the counter by value (defaults to 1).

record(value[, tags, _internal])

Record the metric point of the metric.

set_default_tags(default_tags)

Set default tags of metrics.

Attributes

info

Return the information of this metric.