Enabled all Ruff lint rules and resolved findings.
CI / Formatting (push) Successful in 27s
CI / Linting (push) Successful in 9s
CI / Tests (push) Successful in 34s
CI / Type Checking (push) Successful in 7s
CI / Spelling (push) Successful in 7s

This commit is contained in:
2026-05-18 11:10:46 -04:00
parent 48a4fb9bbf
commit 795184cd17
11 changed files with 211 additions and 123 deletions
+3 -2
View File
@@ -66,7 +66,8 @@ class _ResponseTimer:
"""Mark the request as successful so the duration is recorded."""
self._should_observe = True
def _finalize(self) -> None:
def finalize(self) -> None:
"""Record or discard the timing observation when the block exits."""
if self._should_observe:
self._gauge.labels(domain=self._domain).set(
max(time.monotonic() - self._start, 0)
@@ -196,7 +197,7 @@ class MetricsService:
try:
yield timer
finally:
timer._finalize()
timer.finalize()
def set_build_info(self, version: str) -> None:
"""Set the build version info metric.