ray.util.metrics.Histogram#

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

Bases: Metric

Tracks the size and number of events in buckets.

Histograms allow you to calculate aggregate quantiles such as 25, 50, 95, 99 percentile latency for an RPC.

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

Parameters:
  • name – Name of the metric.

  • description – Description of the metric.

  • boundaries – Boundaries of histogram buckets.

  • tag_keys – Tag keys of the metric.

DeveloperAPI: This API may change across minor Ray releases.

Methods

observe

Observe a given value and add it to the appropriate bucket.

record

Record the metric point of the metric.

set_default_tags

Set default tags of metrics.

Attributes

info

Return information about histogram metric.