Found it. It is the function “site_aggregates_activity” which essentially says if you have published a comment or a post since the target time (day, month, 6 month etc) you are considered active. Here is the code
select c.creator_id from comment c
inner join person u on c.creator_id = u.id
where c.published > (‘now’::timestamp - i::interval)
and u.local = true
union
select p.creator_id from post p
inner join person u on p.creator_id = u.id
where p.published > (‘now’::timestamp - i::interval)
and u.local = true
Out of interest, do we have stats on daily active users? (Preferably where “active” is defined by “makes at least one comment or post”.)
I couldn’t find anything. I’m sure it is in the code here somewhere but can’t find it in there either. https://codeberg.org/thefederationinfo/the-federation.info
Found it. It is the function “site_aggregates_activity” which essentially says if you have published a comment or a post since the target time (day, month, 6 month etc) you are considered active. Here is the code
Looks like the data actually is calculated by lemmy not the logging tool as it is just the stats from the Aussie Zone public api…
Eg. id":1,“site_id”:1,“users”:1319,“posts”:1228,“comments”:13307,“communities”:32,“users_active_day”:170,“users_active_week”:300,“users_active_month”:481,“users_active_half_year”:481}
So the answer would actually be in the lemmy documentation…