From 786e480f2389b84d350ab10117296b1f9f09a667 Mon Sep 17 00:00:00 2001 From: Florian Schmidt Date: Mon, 17 Apr 2017 17:06:53 +0200 Subject: [PATCH] Remove usages of RequestContext::getStats() Bug: T156810 Change-Id: Ic07896a68389e20ce0a35a06049b8c51b6c3f699 --- includes/GlobalFunctions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 243d066184..b9810201c0 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -27,6 +27,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { use Liuggio\StatsdClient\Sender\SocketSender; use MediaWiki\Logger\LoggerFactory; use MediaWiki\Session\SessionManager; +use MediaWiki\MediaWikiServices; use Wikimedia\ScopedCallback; // Hide compatibility functions from Doxygen @@ -1197,7 +1198,9 @@ function wfLogProfilingData() { $statsdSender = new SocketSender( $statsdHost, $statsdPort ); $statsdClient = new SamplingStatsdClient( $statsdSender, true, false ); $statsdClient->setSamplingRates( $config->get( 'StatsdSamplingRates' ) ); - $statsdClient->send( $context->getStats()->getBuffer() ); + $statsdClient->send( + MediaWikiServices::getInstance()->getStatsdDataFactory()->getBuffer() + ); } catch ( Exception $ex ) { MWExceptionHandler::logException( $ex ); } @@ -1262,7 +1265,7 @@ function wfLogProfilingData() { * @return void */ function wfIncrStats( $key, $count = 1 ) { - $stats = RequestContext::getMain()->getStats(); + $stats = MediaWikiServices::getInstance()->getStatsdDataFactory(); $stats->updateCount( $key, $count ); } -- 2.20.1