trademachines/riemann-client-php

Rieman客户端的PHP版本

这个包的官方仓库似乎已不存在,因此该包已被冻结。

1.2.0 2016-10-17 15:05 UTC

This package is not auto-updated.

Last update: 2024-01-20 14:26:16 UTC


README

Build Status

Rieman提供的简单PHP客户端

用法

$socket = new UdpSocket('127.0.0.1', 5555);
// To use a tcp socket:
// $socket = new TcpSocket('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);

安装

Composer

您可以使用composer安装此包,只需将 "trademachines/riemann-client-php" 添加到您的 composer.json 文件中。

{
    "require": {
        "trademachines/riemann-client-php": "dev-master"
    }
}

待办事项

  • UDP数据包大小控制