jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/348470 )

Change subject: Remove usages of RequestContext::getStats()
......................................................................


Remove usages of RequestContext::getStats()

Bug: T156810
Change-Id: Ic07896a68389e20ce0a35a06049b8c51b6c3f699
---
M includes/GlobalFunctions.php
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 243d066..b981020 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -27,6 +27,7 @@
 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 @@
                        $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 @@
  * @return void
  */
 function wfIncrStats( $key, $count = 1 ) {
-       $stats = RequestContext::getMain()->getStats();
+       $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
        $stats->updateCount( $key, $count );
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/348470
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic07896a68389e20ce0a35a06049b8c51b6c3f699
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to