Add StatsD metric logging
authorOri Livneh <ori@wikimedia.org>
Fri, 20 Feb 2015 08:23:18 +0000 (00:23 -0800)
committerOri Livneh <ori@wikimedia.org>
Mon, 9 Mar 2015 23:57:14 +0000 (16:57 -0700)
commit87dfc20b1e19491f90ecd2c8ee82268c244f92c7
treeaed29f1c01c5f09e0427f2e3c19938d9eec3e45f
parente83bb46bf45d9206a560f39c5216faaf260633a8
Add StatsD metric logging

This patch adds a metric data service object to the IContextSource interface,
with full support for StatsD meters, gauges, counters and timing metrics, via
the liuggio/statsd-php-client, which this patch also introduces.

Usage example:

    $stats = $context->getStats();
    $stats->increment( 'resourceloader.cache.hits' );
    $stats->timing( 'resourceloader.cache.rtt', $rtt );

The metrics are flushed to a StatsD server, which may be specified via the
'StatsdServer' configuration key. If no such configuration key exists, the
metrics are discarded.

The StatsD client supplants MediaWiki's StatCounter class. wfIncrStats()
will continue to work, but it will delegate to the StatsD data object.

Change-Id: Ie10db1c154d225971398e189737de7c560bf0f90
RELEASE-NOTES-1.25
autoload.php
composer.json
includes/GlobalFunctions.php
includes/StatCounter.php [deleted file]
includes/context/ContextSource.php
includes/context/DerivativeContext.php
includes/context/IContextSource.php
includes/context/RequestContext.php
includes/libs/BufferingStatsdDataFactory.php [new file with mode: 0644]
includes/page/Article.php