Pull count of detection events by label into prometheus metrics (#20119)

* pull count of detection events by label into prometheus metrics

* format changes with ruff

* remove unneeded f-string

* fix imports format

---------

Co-authored-by: iesad <iesad>
This commit is contained in:
iesad
2025-09-19 06:27:20 -06:00
committed by GitHub
co-authored by iesad <iesad>
parent 1408abb050
commit dc96940eb9
4 changed files with 136 additions and 46 deletions
+10 -3
View File
@@ -261,12 +261,19 @@ class TestHttp(unittest.TestCase):
assert Recordings.get(Recordings.id == rec_k3_id)
def _insert_mock_event(id: str, start: int, end: int, retain: bool) -> Event:
def _insert_mock_event(
id: str,
start: int,
end: int,
retain: bool,
camera: str = "front_door",
label: str = "Mock",
) -> Event:
"""Inserts a basic event model with a given id."""
return Event.insert(
id=id,
label="Mock",
camera="front_door",
label=label,
camera=camera,
start_time=start,
end_time=end,
top_score=100,