承接 iankibet/influxdb 相关项目开发

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

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

iankibet/influxdb

最新稳定版本:1.0.0

Composer 安装命令:

composer require iankibet/influxdb

包简介

Laravel package for interacting with influxDB

README 文档

README

Installation

  1. Install the package via Composer:
composer require iankibet/influxdb
  1. Publish the configuration file:
php artisan vendor:publish --provider="Iankibet\InfluxDB\InfluxDBServiceProvide"
  1. Configure the package by setting the following environment variables in your .env file:
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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-30