Page MenuHomePhabricator

AbuseFilter statistics (but not "profiling" data) are reset every 10000 actions
Closed, ResolvedPublic

Description

AbuseFilter statistics are reset every 10000 actions. This affects the "Of the last 5,045 actions, this filter has matched 0 (0.00%)" on filter pages, and "Of the last 6,321 actions, 0 (0.00%) have reached the condition limit of 1,000, and 50 (0.79%) have matched one of the filters currently enabled." on AbuseFilter main page.

The limit of 10000 is hardcoded in AbuseFilter::recordStats().

10000 actions is literally a couple of minutes on more active Wikimedia wikis like Commons or English Wikipedia. This makes it useless for knowing the long-term impact of filters, or for knowing whether filters are bumping into the condition limit.

Event Timeline

@matmarex Yes, I agree that on large wikis 10000 actions is almost nothing. However, what would you propose? Set different values for every wiki? Raise the hardcoded one? Or even something else?

Sorry, I haven't really thought about the solution here, I just filed the problem. :)

@matmarex It's not a problem, I was just asking for ideas :) A proposal might be to first move the value to a dedicated global variable, declare it where necessary and give it a default of 10000. Then we wait for every wiki to eventually ask to set a value, more or less like we do for blocks. Of course, we may already set a higher default for large wikis, e.g. 30000 actions for wikis in top 10.

Change 424028 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Move actions limit to a global variable

https://gerrit.wikimedia.org/r/424028

Change 424028 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Move actions limit to a global variable

https://gerrit.wikimedia.org/r/424028

The limit is now a global variable, and thus configurable on a per-wiki basis. While this task is itself resolved, now I'll add documentations for the new variable and every wiki will be able to request its own value.