Page MenuHomePhabricator

Profiling (run time, avg conditions) sometimes doesn't work
Open, Needs TriagePublic

Description

I noticed some enabled filters on enwiki are average at consuming 0 conditions, and at 0 ms run time. This shouldn't be possible, because the first condition is always ran, right?

Examples:

Event Timeline

Indeed, this is strange: they should use at least one condition for each execution. Unfortunately at the moment I'm not able to go through and try to debug, but I'd suggest another approach. We currently have a bunch of tasks and related patches all aiming to strongly reinforce the profiling system, e.g. https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/201104/ (sorry but right now I can't provide more links. Basically all "related changes" patches, as well as related phab tasks are relevant). So I'd suggest to wait for those tasks to be resolved and see what happens: it may solve the problem, or give us a quite different code where we should look for problems.

Thanks, I'll try and help test those patches soon!

As a workaround, it seems modifying the filter forces it start profiling again.

Many thanks :-) I'm still doubtful since the 0 conditions stuff shouldn't happen, and would love to determine where did the problem originate. Maybe T191430 could be related? I mean, if there had been many stashed edits, for which a part of the profiling doesn't work (see the last table in the linked task), they may have increased the total amount of executions, but not the number of used conditions for every single execution. This could have brought the average count below 0.5, thus causing a rounding error which in turn caused it to be displayed as a flat zero.