mediawiki-extensions-Linter/includes
sbailey 201b47e01d Make Linter category counts more accurate when counts are low
* The code now produces an accurate count if the number of
   errors for a category is below the threshold set by a
   public constant MAX_ACCURATE_COUNT (currently 20).
   The database record count limit was originally set to 1,
   to determine accurately, if there were actually 0 errors
   in a category as the estimate code would never report 0.
   If not 0, it would use the estimated count which does not
   produce an accurate count for any other number of errors.
   For low error counts this is annoying to editors and
   unnecessary. The additional CPU/disk activity to accurately
   check for low error counts is not significantly more than
   checking for 0 or 1, as checking for 0 likely requires
   a complete table scan which is probably expensive compared
   to a low count that early outs when it hits to record limit.

 * An improvement to consider is recording the accurate count in
   a separate tiny table, and maintaining an accurate count there
   which is used in preference to doing the select with row limit
   based on say a 30 second TTL, to prevent a stampede of requests
   from doing extraneous database operations.

 * Added unit test coverage for accurately counting low error
   conditions that are lower than the threshold and also verify
   that the estimate is inaccurate beyond the error count
   threshold.

Bug: T194872
Change-Id: I4f74cfe3bf9601baa0dc8fa6464a68030ac2bc4b
2021-04-27 10:38:24 -07:00
..
ApiQueryLintErrors.php ApiQueryLintErrors: Allow querying by page title 2020-06-09 20:38:21 +02:00
ApiQueryLinterStats.php Add API meta=linterstats module 2017-06-06 10:02:49 -07:00
ApiRecordLint.php Implement ParserLogLinterData hook 2019-11-27 13:51:01 -05:00
CategoryManager.php Fix PSR12.Properties.ConstantVisibility.NotFound 2020-09-19 17:07:37 +00:00
Database.php Make Linter category counts more accurate when counts are low 2021-04-27 10:38:24 -07:00
Hooks.php Convert Linter to abstract schema 2020-08-22 23:33:46 +01:00
LintError.php Allow Parsoid to provide category ID hints 2019-12-03 23:26:34 -05:00
LintErrorsPager.php Remove use of Title::quickUserCan 2020-02-12 06:57:54 +00:00
MissingCategoryException.php Handle non-existent categories in the database better 2017-10-31 10:42:07 -07:00
RecordLintJob.php Allow Parsoid to provide category ID hints 2019-12-03 23:26:34 -05:00
SpecialLintErrors.php build: Updating mediawiki/mediawiki-codesniffer to 29.0.0 2020-01-10 10:06:28 +00:00
TotalsLookup.php build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 2017-06-20 00:10:41 -07:00