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

Method time

prometheus_client/metrics.py:558–563  ·  view source on GitHub ↗

Time a block of code or function, and observe the duration in seconds. Can be used as a function decorator or context manager.

(self)

Source from the content-addressed store, hash-verified

556 self._sum.inc(amount)
557
558 def time(self) -> Timer:
559 """Time a block of code or function, and observe the duration in seconds.
560
561 Can be used as a function decorator or context manager.
562 """
563 return Timer(self, 'observe')
564
565 def _child_samples(self) -> Iterable[Sample]:
566 samples = [

Callers

nothing calls this directly

Calls 1

TimerClass · 0.85

Tested by

no test coverage detected