What unit on user_visits.time_read?

AI-generated summary

The discussion revolves around figuring out the unit for the time_read column in the user_visits table in Discourse’s database. /t/-/238908

ganncamp asked what the unit was, as they doubted it was minutes given some very high values. /t/-/238908

simon clarified that time_read measures the number of seconds a user has spent on a site page.

ganncamp was confused by this, thinking it must be incorrect based on some 0 values they saw.

Finally, gassim tested it and confirmed time_read measures the time in seconds spent on a topic page specifically, not overall time on the site.

It’s not obvious to me what the unit is on the read_time column in the user_visits table. I want to think it’s minutes, but looking at my data… I don’t really believe any one person has spent 224 minutes reading in my community today. Unfortunately.

The time_read is the number of seconds that the user has spent on the site.

I wonder if there’s anything that could be done to make that obvious in the data that’s displayed on the Data Explorer sidebar.

Thanks.

That wasn’t my assumption, given that I have users with user_visit records with 0s/NULL form both posts_read and time_read.

I assumed that meant they loaded the site and looked at a list of posts(?) but didn’t click through…?

Yes, I think it is the time spent on a topic page, but I was wondering about the unit whether it’s seconds or minutes. I tested by checking my username and I had not spent any time reading any topic post so I clicked on a topic and waited a little bit then came back and it was 217 so it’s seconds. It’s 100% not time spent on the site because I’ve been working on the Data Explorer for more than an hour! :slight_smile: