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

Method time

prometheus_client/metrics.py:685–690  ·  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

683 break
684
685 def time(self) -> Timer:
686 """Time a block of code or function, and observe the duration in seconds.
687
688 Can be used as a function decorator or context manager.
689 """
690 return Timer(self, 'observe')
691
692 def _child_samples(self) -> Iterable[Sample]:
693 samples = []

Callers

nothing calls this directly

Calls 1

TimerClass · 0.85

Tested by

no test coverage detected