Metrix is a PHP library that provides a simple interface for sending metric data to a number of services. Currently Metrix supports StatsD and Librato.
Librato:
$client = new Metrix();
$client->config(array(
'backend' => 'librato',
'opts' => array(
'email' => '[email protected]',
'token' => '123'
)
));
StatsD:
$client = new Metrix();
$client->config(array(
'backend' => 'statsd',
'opts' => array(
'host' => '127.0.0.1', // defaults to this
'port' => '8125' // defaults to this
)
));
$client->increment('key', 10);
$client->increment(array('key1', 'key2', ...));
$client->increment(array(
'key' => 1
));
$client->decrement('key', 10);
...
$client->gauge('cputemp', 55);
Custom key prefixes (prefix_delimeter defaults to '.'):
$client->config(array('
'prefix' => 'foo',
'prefix_delimeter' => ':',
...
));
- Specify
source
for Metrics