MCPcopy Index your code
hub / github.com/prometheus/client_python / collect

Method collect

prometheus_client/metrics.py:89–93  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87 return [self._get_metric()]
88
89 def collect(self) -> Iterable[Metric]:
90 metric = self._get_metric()
91 for suffix, labels, value, timestamp, exemplar, native_histogram_value in self._samples():
92 metric.add_sample(self._name + suffix, labels, value, timestamp, exemplar, native_histogram_value)
93 return [metric]
94
95 def __str__(self) -> str:
96 return f"{self._type}:{self._name}"

Callers

nothing calls this directly

Calls 3

_get_metricMethod · 0.95
_samplesMethod · 0.95
add_sampleMethod · 0.80

Tested by

no test coverage detected