Add last visit statistics in the user directory for admin

at the user directory in admin panel, i.e. /admin/users/list/active path, there are statistics about all-time users activity. for example total read time, total post views, … .

it’d help much more to moderators and community management if in this panel the latest visits are shown, ot latest + total together.

since then the community manager can decide who has enough interactions with posts (read enough posts), who is bored, who is … .

what is your idea?

I had a hard time wrapping my head around this. Could you please try rephrase it along with some pictures?

1 Like

My take is what I might call “last session statistics”. The “latest” time is there - the min, hr, days ago column.

But there is nothing about what they did during that particular visit. For example, columns for someone that logged in, checked a topic for a reply, and then left, compared to another that read a bunch, posted a few, liked, etc. show no distinction.

AFAIK, data this granular is not currently easily possible for most data and would require at least another table. A table that in my estimation would be massive.

I have been working on a script that uses exported data and tables of monthly “snapshots” so that I can use JOINS to graph monthly changes and it is an extremely resource intensive script.

My suggestion is that if any steps in this direction are taken it be only slightly more granular than cumulative. “session stats” feel like a no-go. Though the data would be interesting and most likely helpful, I’m not convinced the cost would be worth it.

On the other hand, there are tables that can be queried when this kind of member-level information is desired. I just can’t see it as an “always displayed for everyone” feature.

2 Likes

@Mittineague has explained it very well. I hope that helps.

to add a simple example:

a while ago, only the all-time read time of each user were shown to both admins and users. but after a while recent read time was also added. the later gives much more information about state of a user at the current moment.

now imagine in the admin user directory the below information were all about recent time and not all-time:


I agree that it would be massive to have last session statistics, but what about recent?

or a better question: how do you use “all the time”-information in the user directory? does it show you anything?

p.s.: sorry for bad English, and I hope it’s understandable enough.

AFAIK, the “read recently” uses the user_visits table
https://github.com/discourse/discourse/blob/master/app/models/user_visit.rb#L60-L73

I don’t know when the job runs, maybe only when a profile / usercard is viewed?

My guess is it might be easy enough to replicate the time_read code to a posts_read, though I’m not so sure how useful that would be. IMHO, time read is more valuable than a count that could include quick scans as well as careful reading.

And if the job runs only when a profile / usercard is viewed, that is a lot less resource use compared to displaying the information in a list.

EDIT
I was just thinking that the profile / usercard has a “last posted at” that might be usable in other places as well.

1 Like