mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:52:23 +01:00
metrics: Do not include user with empty queue left
This commit is contained in:
@ -28,9 +28,8 @@ for queue in Queue.objects.all():
|
||||
# sqlite3. This makes testing a bit tedious. Also, it does not give me
|
||||
# that much of confidence that it would also work on mysql.
|
||||
# Furtermore, we do not expect the queue to be very long at any moment.
|
||||
return len(set(PlaylistSong.objects
|
||||
.filter(Q(playlist=queue.playlist_id), Q(state=0) | Q(state=1))
|
||||
.values_list('user')))
|
||||
return len(set(PlaylistSong.objects.filter(playlist=queue.playlist_id, state=0)
|
||||
.values_list('user')))
|
||||
|
||||
queue_length_gauge.labels(name=queue).set_function(_get_queue_length)
|
||||
queue_duration_gauge.labels(name=queue).set_function(_get_queue_duration)
|
||||
|
||||
Reference in New Issue
Block a user