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

Method clear

prometheus_client/metrics.py:255–262  ·  view source on GitHub ↗

Remove all labelsets from the metric

(self)

Source from the content-addressed store, hash-verified

253
254
255 def clear(self) -> None:
256 """Remove all labelsets from the metric"""
257 if 'prometheus_multiproc_dir' in os.environ or 'PROMETHEUS_MULTIPROC_DIR' in os.environ:
258 warnings.warn(
259 "Clearing labels has not been implemented in multi-process mode yet",
260 UserWarning)
261 with self._lock:
262 self._metrics = {}
263
264 def _samples(self) -> Iterable[Sample]:
265 if self._is_parent():

Callers 3

test_clearMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_clearMethod · 0.36