Try to opportunistically flush statsd data in maintenance scripts
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 2 Dec 2017 21:12:41 +0000 (13:12 -0800)
committerBryanDavis <bdavis@wikimedia.org>
Sat, 30 Dec 2017 05:01:21 +0000 (05:01 +0000)
commit336454104d1249439e3ff97746de69c5e7b4a5f9
treec16445bbcbd8a34846172b18221f35a383393bc1
parent18403eef5bfda5c2bb4adfeafab88b2b515642d5
Try to opportunistically flush statsd data in maintenance scripts

This helps to avoid OOMs from buffer build-ups in the statsd
factory object. This piggy-backs on to the same checks used
for deferred update runs. In addition, the output() method
checks if the data size is getting large and emits if needed.

Bug: T181385
Change-Id: I598be98a5770f8358975815e51380c4b8f63a79e
includes/GlobalFunctions.php
includes/MediaWiki.php
includes/libs/stats/BufferingStatsdDataFactory.php
includes/libs/stats/IBufferingStatsdDataFactory.php
includes/libs/stats/NullStatsdDataFactory.php
maintenance/Maintenance.php
tests/phpunit/MediaWikiTestCase.php