MCPcopy
hub / github.com/ray-project/ray / PrometheusTimeseries

Class PrometheusTimeseries

python/ray/_common/test_utils.py:430–445  ·  view source on GitHub ↗

A collection of timeseries from multiple addresses. Each timeseries is a collection of samples with the same metric name and labels. Concretely: - components_dict: a dictionary of addresses to the Component labels - metric_descriptors: a dictionary of metric names to the Metric object

Source from the content-addressed store, hash-verified

428
429@dataclass
430class PrometheusTimeseries:
431 """A collection of timeseries from multiple addresses. Each timeseries is a
432 collection of samples with the same metric name and labels. Concretely:
433 - components_dict: a dictionary of addresses to the Component labels
434 - metric_descriptors: a dictionary of metric names to the Metric object
435 - metric_samples: the latest value of each label
436 """
437
438 components_dict: Dict[str, Set[str]] = field(default_factory=dict)
439 metric_descriptors: Dict[str, "Metric"] = field(default_factory=dict)
440 metric_samples: Dict[frozenset, "Sample"] = field(default_factory=dict)
441
442 def flush(self):
443 self.components_dict.clear()
444 self.metric_descriptors.clear()
445 self.metric_samples.clear()
446
447
448def fetch_raw_prometheus(prom_addresses, timeout=None):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…