Page MenuHomePhabricator

Add properties created to admin stats on wikidata
Open, MediumPublicFeature

Description

Properties created should be included as a statistic. Query that retrieves the info:

Properties created
use wikidatawiki_p;
SELECT
  actor_name AS 'User',
  COUNT(*) AS 'Properties created'
FROM
  revision_userindex
  JOIN page ON rev_page = page_id
  JOIN actor ON rev_actor = actor_id
WHERE
  page_namespace = 120
  AND rev_parent_id = 0
GROUP BY
  rev_actor

I ran it a few times, and it took between 3.5 seconds and just under a minute. Combined with caching, it should be pretty fast

Event Timeline

This is similar to T171996 in that the architecture currently revolves solely around logged actions. We can add in extra queries for sure, it just might require a lot of reworking of the code.

Admin Stats surprisingly runs pretty fast on Wikidata. I'm guessing there a lot fewer logged actions than other wikis like English Wikipedia (at least fewer admins). https://xtools.wmflabs.org/adminstats/www.wikidata.org/2019-04-25/2020-04-25 (maximum date range) ran in just 4.5 seconds, so I think we can afford the query for properties created.

I won't have time to work on this for a while but I'm more than happy to do code review.

MusikAnimal triaged this task as Medium priority.Mar 4 2021, 5:44 AM
MusikAnimal changed the subtype of this task from "Task" to "Feature Request".

This is similar to T171996 in that the architecture currently revolves solely around logged actions.

Can't this one be done using the page creation log?

This is similar to T171996 in that the architecture currently revolves solely around logged actions.

Can't this one be done using the page creation log?

Not without some major reworking, no. The actions reported in AdminStats come from a configuration file where you specify the log type and log action – nothing more. We'll need some custom handling to support properties created, but if/when we do this then yes, I think using the page creation log will probably be more efficient (though the data only goes back to June 2018).