From 8c0ff6872d64286c69c2f3ee51e827f449a34db8 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Fri, 12 Jun 2015 10:41:52 -0700 Subject: [PATCH] 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 --- includes/jobqueue/JobQueue.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 ); } /** -- 2.20.1