User::pingLimiter() profiles per action as well

We had an outage beginning of may that involved rate limiting of the
'renderfile-nonstandard' action.  This makes User::pingLimiter() to
record a per action profiling point in addition to the generic one, that
would let us finely graph actions being throttled.

Ref:
https://wikitech.wikimedia.org/wiki/Incident_documentation/20140503-Thumbnails#What_can_be_improved

Bug: 65477
Change-Id: Iac7930e85f7d9101663656ccb2bccdbebf908693
This commit is contained in:
Antoine Musso 2014-05-19 12:45:11 +02:00
parent 638478158a
commit 1b0603ce0f
2 changed files with 7 additions and 0 deletions

View file

@ -60,6 +60,8 @@ changes to languages because of Bugzilla reports.
* The deprecated function mw.util.toggleToc was removed.
* The Special:Search hooks SpecialSearchGo and SpecialSearchResultsAppend
were removed as they were unused.
* (bug 65477) User::pingLimiter() now has an additional profile point varying
by action being used.
* mediawiki.util.$content no longer supports old versions of the Vector,
Monobook, Modern and CologneBlue skins that don't yet implement the "mw-body"
and/or "mw-body-primary" class name in their html.

View file

@ -1672,6 +1672,9 @@ class User {
* Primitive rate limits: enforce maximum actions per time period
* to put a brake on flooding.
*
* The method generates both a generic profiling point and a per action one
* (suffix being "-$action".
*
* @note When using a shared cache like memcached, IP-address
* last-hit counters will be shared across wikis.
*
@ -1698,6 +1701,7 @@ class User {
global $wgMemc;
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__ . '-' . $action );
$limits = $wgRateLimits[$action];
$keys = array();
@ -1776,6 +1780,7 @@ class User {
}
}
wfProfileOut( __METHOD__ . '-' . $action );
wfProfileOut( __METHOD__ );
return $triggered;
}