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

Method dec

prometheus_client/metrics.py:451–456  ·  view source on GitHub ↗

Decrement gauge by the given amount.

(self, amount: float = 1)

Source from the content-addressed store, hash-verified

449 self._value.inc(amount)
450
451 def dec(self, amount: float = 1) -> None:
452 """Decrement gauge by the given amount."""
453 if self._is_most_recent:
454 raise RuntimeError("dec must not be used with the mostrecent mode")
455 self._raise_if_not_observable()
456 self._value.inc(-amount)
457
458 def set(self, value: float) -> None:
459 """Set gauge to the given value."""

Callers 2

__exit__Method · 0.80
test_gaugeMethod · 0.80

Calls 2

incMethod · 0.45

Tested by 1

test_gaugeMethod · 0.64