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.