Page MenuHomePhabricator

NullStatsdDataFactory can't be used as StatsdDataFactory service
Closed, ResolvedPublic

Description

If we try to use NullStatsdDataFactory instead of BufferingStatsdDataFactory, we get this error:

PHP Fatal error:  Call to undefined method NullStatsdDataFactory::getBuffer() in /srv/mediawiki/php-1.30.0-wmf.2/includes/GlobalFunctions.php on line 1203

This is because the code in wfLogProfilingData() calls getBuffer() which is not part of StatsdDataFactoryInterface. We should refactor it so that core code uses proper interfaces and both "null" and "buffered" classes implement them.

Additionally, getStatsdDataFactory) is defines as returning StatsdDataFactory not StatsdDataFactoryInterface, which makes NullStatsdDataFactory class inapplicable for this interface.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 26 2017, 12:04 AM

Change 355733 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[mediawiki/core@master] Refactor Statsd classes to enable null collector to work.

https://gerrit.wikimedia.org/r/355733

Smalyshev added a subscriber: Tgr.May 26 2017, 12:30 AM

Change 355733 merged by jenkins-bot:
[mediawiki/core@master] Refactor Statsd classes to enable null collector to work.

https://gerrit.wikimedia.org/r/355733

Smalyshev closed this task as Resolved.Jun 1 2017, 6:53 PM
Smalyshev claimed this task.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Mass-moving all items tagged for MediaWiki 1.30.0-wmf.3, as that was never released; instead, we're using -wmf.4.

Change 363997 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] statsd: Rename MediawikiStatsdDataFactory to IBufferingStatsdDataFactory

https://gerrit.wikimedia.org/r/363997

Change 363997 merged by jenkins-bot:
[mediawiki/core@master] statsd: Rename MediawikiStatsdDataFactory to IBufferingStatsdDataFactory

https://gerrit.wikimedia.org/r/363997