2017 © Pedro PelĂĄez
 

library laravel-influxdb

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

image

tray-labs/laravel-influxdb

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  • Tuesday, March 27, 2018
  • by tray-labs
  • Repository
  • 0 Watchers
  • 11 Stars
  • 5,452 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 8 Versions
  • 36 % Grown

The README.md

Laravel Influxdb

A service made to provide, set up and use the library from influxdata influxdb-php in Laravel., (*1)

Installing

  • Install by composer command:
composer require tray-labs/laravel-influxdb
  • Or add this line to require section of composer.json and execute on your terminal $ composer install
"require": {
    "tray-labs/laravel-influxdb": "^1.0"
}

Register service provider(pick one of two).

  • Laravel: in config/app.php file, Laravel 5.5+ supports package discovery automatically, you should skip this step php 'providers' => [ // ... TrayLabs\InfluxDB\Providers\ServiceProvider::class, ] php 'aliases' => [ // ... 'InfluxDB' => TrayLabs\InfluxDB\Facades\InfluxDB::class, ]
  • Lumen: in bootstrap/app.php file, (*2)

    // config
    $app->configure('InfluxDB');
    
    $app->register(TrayLabs\InfluxDB\Providers\LumenServiceProvider::class);
    $app->alias('InfluxDB', TrayLabs\InfluxDB\Facades\InfluxDB::class);
    
  • Define env variables to connect to InfluxDB, (*3)

INFLUXDB_HOST=localhost
INFLUXDB_PORT=8086
INFLUXDB_USER=some_user
INFLUXDB_PASSWORD=some_password
INFLUXDB_SSL=false
INFLUXDB_VERIFYSSL=false
INFLUXDB_TIMEOUT=0
INFLUXDB_DBNAME=some_database
INFLUXDB_UDP_ENABLED=false # Activate UDP
INFLUXDB_UDP_PORT=4444 # Port for UDP
  • Write this into your terminal inside your project
    • Laravel ini php artisan vendor:publish
    • Lumen ini cp vendor/TrayLabs/lumen-influxdb/config/InfluxDB.php config/InfluxDB.php

Reading Data

<?php

// executing a query will yield a resultset object
$result = InfluxDB::query('select * from test_metric LIMIT 5');

// get the points from the resultset yields an array
$points = $result->getPoints();

Writing Data

<?php

// create an array of points
$points = array(
    new InfluxDB\Point(
        'test_metric', // name of the measurement
        null, // the measurement value
        ['host' => 'server01', 'region' => 'us-west'], // optional tags
        ['cpucount' => 10], // optional additional fields
        time() // Time precision has to be set to seconds!
    ),
    new InfluxDB\Point(
        'test_metric', // name of the measurement
        null, // the measurement value
        ['host' => 'server01', 'region' => 'us-west'], // optional tags
        ['cpucount' => 10], // optional additional fields
        time() // Time precision has to be set to seconds!
    )
);

$result = InfluxDB::writePoints($points, \InfluxDB\Database::PRECISION_SECONDS);

License

This project is licensed under the MIT License, (*4)

The Versions

27/03 2018

dev-master

9999999-dev

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

MIT commercial

The Requires

 

by Tray Labs

27/03 2018

dev-revert-13-patch-1

dev-revert-13-patch-1

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

MIT

The Requires

 

by Tray Labs

02/02 2018

1.0.5

1.0.5.0

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

MIT

The Requires

 

by Tray Labs

19/06 2017

1.0.4

1.0.4.0

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

commercial

The Requires

 

by Tray Labs

16/06 2017

1.0.3

1.0.3.0

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

commercial

The Requires

 

by Tray Labs

14/06 2017

1.0.2

1.0.2.0

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

commercial

The Requires

 

by Tray Labs

14/06 2017

1.0.1

1.0.1.0

A service made to provide, set up and use the library from influxdata influxphp in Laravel.

  Sources   Download

commercial

The Requires

 

by Tray Labs

13/06 2017

1.0.0

1.0.0.0

Client de conexĂŁo ao banco de dados Influx para ser usado no Desk360 da Tray

  Sources   Download

commercial

The Requires

 

by Tray Tecnologia