Fix duration aggregation
This commit is contained in:
parent
19fed23ed6
commit
00ef610a65
@ -125,7 +125,7 @@ class Service(models.Model):
|
|||||||
try:
|
try:
|
||||||
avg_session_duration = sessions.annotate(
|
avg_session_duration = sessions.annotate(
|
||||||
duration=models.F("last_seen") - models.F("start_time")
|
duration=models.F("last_seen") - models.F("start_time")
|
||||||
).aggregate(duration=models.Avg("duration"))["duration"]
|
).aggregate(time_delta=models.Avg("duration"))["time_delta"]
|
||||||
except NotSupportedError:
|
except NotSupportedError:
|
||||||
avg_session_duration = sum(
|
avg_session_duration = sum(
|
||||||
[
|
[
|
||||||
|
Loading…
Reference in New Issue
Block a user