API: Optionally include in job queue size in maxlag
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 10 Apr 2017 06:54:01 +0000 (23:54 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Tue, 11 Apr 2017 02:24:24 +0000 (19:24 -0700)
commitde9f9bda7db9d607767968ddaf1a55a50916a4b1
treeb13e4e4f4f573ed6010c97df7a18a8365b009686
parent5f823d1e83de33941e39663c8a48f5ca70a2296d
API: Optionally include in job queue size in maxlag

maxlag is the default mechanism most bots and libraries use in
determining when to back off due to wiki overload. However these days,
there are other things that should be considered when asking bots to
back off, one of those is job queue size.

For compatibility and simplicity of use, the number of jobs is converted
into something resembling seconds using a configurable factor. We also
output the total number of jobs in the API error output so more
sophisticated clients can do a more advanced back off.

Bug: T160003
Change-Id: Iedae2344a3d93202efbdd1bf807cef6165b6257a
includes/DefaultSettings.php
includes/api/ApiMain.php