2014-09-12 08:25:51 +02:00
2014-09-12 08:25:51 +02:00
2014-09-12 08:25:51 +02:00
2014-09-11 15:04:12 +02:00
2014-09-11 15:04:12 +02:00
2014-09-12 08:25:51 +02:00
2014-09-12 08:25:51 +02:00
2014-09-11 09:50:43 +02:00
2014-09-11 15:04:12 +02:00
2014-09-12 08:25:51 +02:00

InfluxDB PHP SDK

  • Build Status
  • Dependency Status

Send metrics to InfluxDB.

$options = new \InfluxDB\Options();

$client = new \InfluxDB\Client();
$client->setAdapter(new \InfluxDB\Adapter\UdpAdapter($options));

$client->mark("search", [
    "query" => "php"
]);

Install it

Just use composer

php composer.phar require corley/influxdb-sdk:*

Or place it in your require section

{
  "require": {
    // ...
    "corley/influxdb-sdk": "*"
  }
}

Send data using HTTP json API

Actually we using Guzzle as HTTP client

$influx->mark("tcp.test", ["mark" => "element"]);

Prepare lib dependencies

Use your DiC or Service Locator in order to provide a configured client

<?php

use InfluxDB\Client;
use InfluxDB\Options;
use InfluxDB\Adapter\GuzzleAdapter as InfluxHttpAdapter;
use GuzzleHttp\Client as GuzzleHttpClient;

$options = new Options();
$options->setHost("analytics.mine.domain.tld");
$options->setPort(8086);
$options->setUsername("root");
$options->setPassword("root");
$options->setDatabase("mine");

$guzzleHttp = new GuzzleHttpClient();
$adapter = new InfluxHttpAdapter($guzzleHttp, $options);

$influx = new Client();
$influx->setAdapter($adapter);

$influx->mark("tcp.test", ["mark" => "element"]);
S
Description
Community-based GPL-licensed network monitoring system
Readme
219 MiB
Languages
PHP 37.2%
JavaScript 33.6%
HTML 24.5%
CSS 3%
Less 0.7%
Other 0.8%