Query to run on the database to find the number of concurrent users -
SELECT COUNT(DISTINCT l.userid) AS unique_users_active
FROM mdl_logstore_standard_log l
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP];
and similarly, to know what they were doing,
SELECT
u.username,
u.firstname,
u.lastname,
FROM_UNIXTIME(l.timecreated) AS time_of_action,
l.eventname,
l.component,
l.target
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE l.timecreated BETWEEN 1791281400 AND 1791285000
ORDER BY l.timecreated ASC;
No comments:
Post a Comment