Storing metrics of /admin/dashboard


#1

Introduce the feature you want to discuss:

The new statistics shown at /admin/dashboard are very useful, especially the active users, a number that /about/more or any other UI didn’t show. Wouldn’t it be great to have proper metrics with graphs, at least about some of these values?

  • Background to problem, alt. feature history

Let’s look at active users. Many admins and instance members will be interested in this metric. However, catching it and storing it to provide meaningful data is very complicated for two reasons:

  1. The data must be captured manually every week, otherwise is lost. I don’t know whether there is an API or an external method to grab it automagically.
  2. The data is about “this week”, which seems to refer to a Monday-Sunday week. This means that you have to be ready to catch the final number on Sunday at 23:59.
  • Kind of feedback you are looking for

Hopefully a developer saying that this suggestion is spot on and easy to implement. :innocent:

  • Possible solutions / or if there are no solutions

Counting “last 7 days” instead of “this week” shouldn’t be that difficult, right? This would provide more reliable data whenever you check the dashboard. It would make it easier to capture “good enough” metrics manually on a periodical basis.

Storing the active users value on a weekly basis would be very useful, even if it is in a plain HTML table showing the last 3 months or something. From there admins could copy & paste in a spreadsheet and from there… Of course it would be better to show the graphs / offer a csv export but maybe this would complicate things too much.

Honestly, the use case for this is pretty simple: send a toot to our community saying “We are NN active users, % more/less than a month ago!” or something along these lines.


#2

Might there be a way to, if not make it a built in function, repurpose something like piwik/matomo to talk to an instance api? That would take care of building a graphic display and even any analytics you’d want to do.

Care should be taken with this, as there is a very strong privacy focused mindset within mastodon, but I have already seen a few data analysis projects sharing relationship graphs of the Federation. Maybe it’s better to get ahead and put easy to use tools in people’s hands that respect privacy rather then leave the need unfilled until someone makes something more invasive?


#3

I might just file this feature request in GitHub, as a first step.


#4

Unfortunately, it is difficult. Active user stats depend on uniqueness within a bucket, e.g. if you have daily buckets, you can’t tell how many unique users there are within a month, because they would sum up and no longer be unique. On the other hand if you use a monthly bucket, you won’t be able to tell how many unique users were active within a week. So, rolling timeframes won’t work, which is why it’s set to a commercial week.