Hi, I found that post count for the latest 30 days in about.json and admin page are different 6242 vs 5562:
Why? Topic count is equal. I tried to do some calculations but did not find any logic.
Discourse 1.9.4
Why post count differs on admin page and about.json
The post count for the latest 30 days in about.json and the admin page differ because they are calculated differently. Ivan_Rapekas noticed this discrepancy, with 6242 posts in about.json and 5562 posts in the admin page.
According to simon, the about.json post count includes all posts, including private messages (PMs), while the admin dashboard post count only includes public regular posts, excluding PMs, moderator actions, small actions, and whisper posts.
Ivan_Rapekas confirms this explanation and notes that the difference is mainly due to the inclusion of small actions (e.g., assignments and un-assignments) in the about.json post count.
The post count is calculated differently on the About page than it is on the Admin Dashboard. On the About page the post count is calculated with Post.count. The query that is used for the 7 day and 30 day periods is similar to this. It will return all posts, including PMs. On the Admin Dashboard the post count is calculated with this:
Post.public_posts.where(post_type: Post.types[:regular])
This will exclude private messages from the post count. It will also exclude moderator action, small action, and whisper posts from the post count.
@simon, thank you for the explanation!
We used to use about.json for statistics on our website. Now we can explain the difference
. Topics number is approx.equal, and posts number includes small actions (assignments and un-assigments, usually +2 per topic, etc).
Solved for me,
Ivan