From: Ori Livneh Date: Fri, 12 Jun 2015 17:41:52 +0000 (-0700) Subject: Job queue: prefix metric keys with 'jobqueue'; segment with '.' X-Git-Tag: 1.31.0-rc.0~11106 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=8c0ff6872d64286c69c2f3ee51e827f449a34db8;p=lhc%2Fweb%2Fwiklou.git Job queue: prefix metric keys with 'jobqueue'; segment with '.' Currently names are segmented with a dash (for legacy reasons), which makes them clutter the top-level MediaWiki.* metric namespace. Change-Id: I785819723808368fbf9c3f5ea167f50f40733a3a --- diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php index 013cc61bf5..1cf1b4b577 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -683,8 +683,12 @@ abstract class JobQueue { * @since 1.22 */ public static function incrStats( $key, $type, $delta = 1 ) { - wfIncrStats( $key, $delta ); - wfIncrStats( "{$key}-{$type}", $delta ); + static $stats; + if ( !$stats ) { + $stats = RequestContext::getMain()->getStats(); + } + $stats->updateCount( "jobqueue.{$key}", $delta ); + $stats->updateCount( "jobqueue.{$key}.{$type}", $delta ); } /**