Add metric 'helpers_registered'
This commit is contained in:
parent
f2dbda15aa
commit
aabbb372b5
|
@ -19,6 +19,25 @@ def metrics(request):
|
|||
"helpers_confirmed_total",
|
||||
Helper.objects.filter(number_validated=True).count(),
|
||||
),
|
||||
(
|
||||
"helpers_registered",
|
||||
Helper.objects.annotate(
|
||||
shift_count=Count(
|
||||
Case(
|
||||
When(
|
||||
shiftregistration__state__in=[
|
||||
ShiftRegistration.RegState.REGISTERED,
|
||||
ShiftRegistration.RegState.CHECKED_IN,
|
||||
],
|
||||
then=1,
|
||||
),
|
||||
output_field=models.IntegerField(),
|
||||
)
|
||||
)
|
||||
)
|
||||
.filter(number_validated=True, shift_count__gte=1)
|
||||
.count(),
|
||||
),
|
||||
(
|
||||
"helpers_helped_total",
|
||||
Helper.objects.annotate(
|
||||
|
|
Loading…
Reference in New Issue