Yields metrics from the collectors in the registry.
(self)
| 86 | return result |
| 87 | |
| 88 | def collect(self) -> Iterable[Metric]: |
| 89 | """Yields metrics from the collectors in the registry.""" |
| 90 | collectors = None |
| 91 | ti = None |
| 92 | with self._lock: |
| 93 | collectors = copy.copy(self._collector_to_names) |
| 94 | if self._target_info: |
| 95 | ti = self._target_info_metric() |
| 96 | if ti: |
| 97 | yield ti |
| 98 | for collector in collectors: |
| 99 | yield from collector.collect() |
| 100 | |
| 101 | def restricted_registry(self, names: Iterable[str]) -> "RestrictedRegistry": |
| 102 | """Returns object that only collects some metrics. |
no test coverage detected