Page MenuHomePhabricator

Create Chart on Product Metrics dashboard for Active and Inactive Editors
Closed, ResolvedPublic8 Estimated Story Points

Description

Total (e.g aggregate across the whole platform) amount of Editors, Active and Inactive
(Active=Edits in <30 days, inactive >30 days)

This may mean we need to regularly run https://www.mediawiki.org/wiki/Manual:InitSiteStats.php.

Alternatively the https://toan-test-wiki-1.wikibase.cloud//w/api.php?action=query&meta=siteinfo&siprop=statistics&format=json might be a good endpoint to check that wouldn't require running this script.

See also: https://github.com/wbstack/mediawiki/issues/59

An existing platform stats job is: https://github.com/wbstack/api/blob/main/app/Jobs/PlatformStatsSummaryJob.php

Event Timeline

Tarrow set the point value for this task to 8.Jul 29 2022, 10:50 AM
Tarrow moved this task from Backlog (incoming) to Ready to Pick Up on the Wikibase Cloud board.

So, we just need to run that job to get those stats.

https://github.com/wbstack/mediawiki/pull/268 adds an internal api endpoint in mediawiki to run that job for a particular wiki

https://github.com/wbstack/api/pull/499 refactors the scheduling of the platform summary to be run last after each wiki gets their stats updated.

Easiest way to try this out would be to skaffold both patches locally then change the values in Kernel.php or manually running the schedule:stats command

Will add follow-up patches for deploying this once they are merged and released.

Tarrow added a subscriber: Deniz_WMDE.

set this back open to review by anyone since Deniz isn't around today

So, we just need to run that job to get those stats.

https://github.com/wbstack/mediawiki/pull/268 adds an internal api endpoint in mediawiki to run that job for a particular wiki

https://github.com/wbstack/api/pull/499 refactors the scheduling of the platform summary to be run last after each wiki gets their stats updated.

Easiest way to try this out would be to skaffold both patches locally then change the values in Kernel.php or manually running the schedule:stats command

Will add follow-up patches for deploying this once they are merged and released.

So I tested both PRs locally and it looks like building the stats works perfectly via the new api command.

Example of showing them via CLI after running SiteStatsUpdateJob manually:

 $ k exec -ti mediawiki-137-fp-app-web-86d89596cf-4wtch -- bash -c 'WBS_DOMAIN=testestest.wbaas.localhost php w/maintenance/showSiteStats.php'
Total edits       : 1
Number of articles: 0
Total pages       : 1
Number of users   : 2
Active users      : 1
Number of images  : 0

But what I'm somehow missing is how we can collect this in metrics - could we include it in the PlatformStatsSummaryJob or create it's own job, or is there even already a place where this gets logged that I fail to spot?

But what I'm somehow missing is how we can collect this in metrics - could we include it in the PlatformStatsSummaryJob or create it's own job, or is there even already a place where this gets logged that I fail to spot?

So once the stats are in the database, which is what the job ends up doing we can just grab it from there and output it in the PlatformStatsSummaryJob. It's already selecting a few pieces from there, but this wasn't included since it was incomplete.

So once the stats are in the database, which is what the job ends up doing we can just grab it from there and output it in the PlatformStatsSummaryJob. It's already selecting a few pieces from there, but this wasn't included since it was incomplete.

Ahh nice! So we only need to include them in the JSON output I guess, cool!

@Deniz_WMDE just fyi, I think it'd be great if we can have 1 collection of usage metrics, so could you add these to the same dashboard as the Wikibase count?

(https://console.cloud.google.com/monitoring/dashboards/builder/c44e69bc-6e8b-430c-82c0-459a936206a5?project=wikibase-cloud&dashboardBuilderState=%257B%2522editModeEnabled%2522:false%257D&timeDomain=1m)

or would it be too slow to load?

@Deniz_WMDE just fyi, I think it'd be great if we can have 1 collection of usage metrics, so could you add these to the same dashboard as the Wikibase count?

Sounds perfect!

We added another patch to the API https://github.com/wbstack/api/pull/506

And added the metrics https://github.com/wmde/wbaas-deploy/pull/490

A new TF module needs to be released and used on staging after the above one gets merged and then we can test it - and deploy it to production afterwards (consisting of 3 ingredients - deploying the current API and MW images as well as the monitoring TF module)

Looks great!
Just 1 comment: Similarly to what was done with describing in the Legend how we define active wiki's, would like to add active editors there

Evelien_WMDE claimed this task.