Simple PHP client for Riemann
$socket = new UdpSocket('127.0.0.1', 5555);
$client = new Client($socket);
$client->sendEvent([
'host' => 'tm',
'service' => 'loader',
'metrics' => 1,
'attributes' => [
[ 'key' => 'source', 'value' => 'my source'],
]
]);
// By default the data will be really send to riemann once 20 events have been queued
// You can still send the data manually by calling:
$client->flush();
// Or by changing the threshold:
$client->setFlushAfter(5);
You can install this package with composer, simply add "trademachines/riemann-client-php" to your composer.json file.
{
"require": {
"trademachines/riemann-client-php": "dev-master"
}
}
- TCP Transport
- UDP Packet size control