From: Antoine Musso Date: Mon, 19 May 2014 10:45:11 +0000 (+0200) Subject: User::pingLimiter() profiles per action as well X-Git-Tag: 1.31.0-rc.0~15646^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=1b0603ce0f4f5547b8117ade8251866628d1aee6;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index bb8dd22e0a..195ecef90f 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -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. diff --git a/includes/User.php b/includes/User.php index 6578341acb..941a40509d 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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; }