2
0
Fork 0

Add metric 'shift_registrations'

This commit is contained in:
Luca 2023-05-08 19:04:43 +02:00
parent aabbb372b5
commit 0cd9f661c7
1 changed files with 9 additions and 0 deletions

View File

@ -73,6 +73,15 @@ def metrics(request):
"messages_sent_total", "messages_sent_total",
Message.objects.all().count(), Message.objects.all().count(),
), ),
(
"shift_registrations",
ShiftRegistration.objects.filter(
state__in=(
ShiftRegistration.RegState.REGISTERED,
ShiftRegistration.RegState.CHECKED_IN,
)
).count(),
),
( (
"worked_seconds_total", "worked_seconds_total",
worked_seconds_total.total_seconds() worked_seconds_total.total_seconds()