Make the format of UDP-logged stats configurable
authorOri Livneh <ori@wikimedia.org>
Tue, 1 Oct 2013 23:20:45 +0000 (16:20 -0700)
committerOri Livneh <ori@wikimedia.org>
Sat, 5 Oct 2013 05:52:02 +0000 (22:52 -0700)
commit2bad0b96645ba40f6d8899d9be51876f7140ab21
tree49e429334122275217234a061b8daf50a3e3c11e
parent9b6ed54c6ae404214b07c5af68c86af0c919077f
Make the format of UDP-logged stats configurable

The format of datagrams generated by StatCounter and ProfilerSimpleUDP is not
described by any standard and appears to have been designed for compatibility
with the logging setup of the Wikimedia Foundation, which limits reusability.

This patch adds two configuration variables, $wgUDPProfilerFormatString and
$wgStatsFormatString, that can be used to specify the precise format that
MediaWiki will use. The default values for these variables causes MediaWiki to
generate the same output as before.

The secret evil plan is to change the defaults so that MediaWiki emits metrics
that are compatible with the popular StatsD format (see
<https://github.com/b/statsd_spec>). This would allow us to replace udpprofiler
with a generic StatsD instance instead.

Change-Id: Iaf00811d3f8d6b89c1c68e84fc1f2c93425d5a2d
RELEASE-NOTES-1.22
includes/DefaultSettings.php
includes/StatCounter.php
includes/profiler/ProfilerSimpleUDP.php