* @file
*/
+use Liuggio\StatsdClient\Factory\StatsdDataFactory;
use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
/**
* Group all the pieces relevant to the context of a request into one instance
*/
private $skin;
- /**
- * @var \Liuggio\StatsdClient\Factory\StatsdDataFactory
- */
- private $stats;
-
/**
* @var Timing
*/
/**
* Get the Stats object
*
- * @return BufferingStatsdDataFactory
+ * @deprecated since 1.27 use a StatsdDataFactory from MediaWikiServices (preferably injected)
+ *
+ * @return StatsdDataFactory
*/
public function getStats() {
- if ( $this->stats === null ) {
- $prefix = rtrim( $this->getConfig()->get( 'StatsdMetricPrefix' ), '.' );
- $this->stats = new BufferingStatsdDataFactory( $prefix );
- }
- return $this->stats;
+ return MediaWikiServices::getInstance()->getStatsdDataFactory();
}
/**