iankibet/influxdb
最新稳定版本:1.0.0
Composer 安装命令:
composer require iankibet/influxdb
包简介
Laravel package for interacting with influxDB
README 文档
README
Installation
- Install the package via Composer:
composer require iankibet/influxdb
- Publish the configuration file:
php artisan vendor:publish --provider="Iankibet\InfluxDB\InfluxDBServiceProvide"
- Configure the package by setting the following environment variables in your
.envfile:
INFLUXDB_HOST=127.0.0.1 INFLUXDB_PORT=8086 INFLUXDB_TOKEN= INFLUXDB_BUCKET= INFLUXDB_ORG=
Usage
Writing Data
use Iankibet\InfluxDb\InfluxDbPoint; use Iankibet\InfluxDb\Facades\InfluxDb; // in your controller/method $point = new InfluxDbPoint(); $point->setMeasurement('measurement_name'); $point->setTags(['tag_key' => 'tag_value']); $point->setFields(['field_key' => 'field_value']); $point->setTime(time()); InfluxDb::write($point);
Querying Data
use Iankibet\InfluxDb\Facades\InfluxDb; $measurement = 'measurement_name'; $fields = [ 'key1'=>'value1', 'key2'=>'value2' ]; $from = '2021-01-01T00:00:00Z'; $to = '2021-01-02T00:00:00Z'; $res = InfluxDb::query('measurement_name', $fields, $from, $to);
For more details, visit the InfluxDB Integration for Laravel: A Comprehensive Guide.
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-30