Skip to content

[Admin Analytics] fix users DAU stats

Administrator requested to merge naman/admin-analytics-users-dau into main

Created by: thenamankumar

https://k8s.sgdev.org/site-admin/analytics/users

The DAU/WAU/MAU stats on the admin analytics users statistics page are wrong. The numbers themselves seem right but they are getting mix-matched with each other. MAU > WAU > DAU (should be).

CleanShot 2022-07-14 at 14 39 47@2x

In the SQL query we are using UNION ALL and scanning rows based on their index, considering 0th row as DAU and so on...

UNION ALL doesn't guarantee any sorting order and I tested it as well.

Fixing the scanning logic in the PR.

Test plan

check the diff

Merge request reports

Loading