acostes / php-redis-timeseries
PHP 库,用于将时间序列分析数据存储到 Redis
dev-master
2016-12-28 15:46 UTC
Requires
- predis/predis: ^1.1
Requires (Dev)
- atoum/atoum: ^2.8
This package is not auto-updated.
Last update: 2024-09-14 19:58:34 UTC
README
PHP 库,用于将时间序列分析数据存储到 Redis
安装
composer require acostes/php-redis-timeseries
用法
use RedisAnalytics\TimeSeries; // You also can add parameters to the constructor to connect to your redis intance // __construct($host = '127.0.0.1', $port = '6379', $database = 0) $ts = new TimeSeries(); // Add a new entry to you key at a specific timestamp $ts->add($myKey, $timestamp, $value); // Retrieve all data for a specific interval $from / $to $ts->get($myKey, $from, $to);
依赖关系
- PHP >= 5.6
- Redis >= 2.6
作者
- Arnaud Costes (twitter)
许可协议
Redistats 的代码在 MIT 许可协议下分发(见LICENSE)。