承接 elemenx/laravel-influxdb 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elemenx/laravel-influxdb

最新稳定版本:0.0.2

Composer 安装命令:

composer require elemenx/laravel-influxdb

包简介

A service made to provide, set up and use the library influxdb-php in Laravel.

README 文档

README

Latest Version Software License Build Status Coverage Status Total Downloads Requires PHP

A service made to provide, set up and use the library influxdb-php in Laravel.

Requirements

  • php >=7.1.3
  • Laravel 5.5+
  • influxdb-php 1.14+

Installation

Begin by pulling in the package through Composer.

$ composer require oanhnn/laravel-influxdb

Usage

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);

Logging

NOTE This feature is available on Laravel version 5.6+.

In config/logging.php file, config you log with driver influxdb

<?php
return [
    // ...
    'channels' => [
        // ...
        'custom' => [
            'driver' => 'influxdb',
            'name'   => 'channel-name',
            'level'  => 'info',
            'bubble' => true,
        ],
        // ...
    ],
    // ...
];

In your code using

Log::channel('custom')->info('Some message');

Changelog

See all change logs in CHANGELOG

Testing

$ git clone git@github.com/oanhnn/laravel-influxdb.git /path
$ cd /path
$ composer install
$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.

Credits

License

This project is released under the MIT License.
Copyright © Oanh Nguyen.

统计信息

  • 总下载量: 2.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-21