Skip to content
Time Series data structure for redis
Branch: master
Clone or download
K-Jo Merge pull request #103 from otnielvh/otnielvh-mget-alter-queryindex-…
…docs

RED-28784 documentation for ALTER, MGET and QUERYINDEX
Latest commit e5854f4 May 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci circleci: use correct path May 21, 2019
RedisModulesSDK @ 79679f6 update RedisModulesSDK Nov 8, 2018
docs Remove maxSamplePerChunks from CREATE documentation May 23, 2019
src circleci calls to clean_ramp May 21, 2019
tools traffic_simulator: do a full verification for the inserted data Feb 28, 2019
.gitignore
.gitmodules fix RedisModulesSDK submodule Feb 15, 2017
Dockerfile renaming artefact Jan 30, 2019
LICENSE License update Feb 21, 2019
README.md Merge branch 'master' into K-Jo-patch-1 May 14, 2019
mkdocs.yml Update mkdocs.yml May 13, 2019
ramp.yml Merge pull request #57 from RedisLabsModules/license-update Feb 21, 2019

README.md

GitHub issues CircleCI Docker Cloud Build Status

RedisTimeSeries

RedisTimeSeries is a Redis Module adding a Time Series data structure to Redis.

Features

  • Quick inserts (50K samples per sec)
  • Query by start time and end-time
  • Query by labels sets
  • Aggregated queries (Min, Max, Avg, Sum, Range, Count, First, Last) for any time bucket
  • Configurable max retention period
  • Compactions/Roll-ups - automatically updated aggregated timeseries
  • labels index - each key has labels which will allows query by labels

Using with other tools metrics tools

In the RedisTimeSeries organization you can find projects that help you integrate RedisTimeSeries with other tools, including:

  1. Prometheus - Adapter for Prometheus to use RedisTimeSeries as backend db.
  2. StatsD, Graphite exports using graphite protocol.
  3. Grafana - using SimpleJson datasource.

Memory model

A time series is a linked list of memory chunks. Each chunk has a predefined size of samples. Each sample is a tuple of the time and the value of 128 bits, 64 bits for the timestamp and 64 bits for the value.

Setup

You can either get RedisTimeSeries setup in a Docker container or on your own machine.

Docker

To quickly tryout RedisTimeSeries, launch an instance using docker:

docker run -p 6379:6379 -it --rm redislabs/redistimeseries

Build and Run it yourself

You can also build and run RedisTimeSeries on your own machine.

Requirements

  • build-essential
  • The RedisTimeSeries repository: git clone https://github.com/RedisTimeSeries/RedisTimeSeries.git

Build

cd RedisTimeSeries
git submodule init
git submodule update
cd src
make all

Run

In your redis-server run: loadmodule redistimeseries.so

For more infomation about modules, go to the redis offical documentation.

Give it a try

After you setup RedisTimeSeries, you can interact with it using redis-cli.

Here we'll create a time series representing sensor temperature measurements. After you create the time series, you can send temperature measurements. Then you can query the data for a time range on some aggreagation rule.

With redis-cli

$ redis-cli
127.0.0.1:6379> TS.CREATE temperature RETENTION 60 LABELS sensor_id 2 area_id 32
OK
127.0.0.1:6379> TS.ADD temperature:3:11 1548149181 30
OK
127.0.0.1:6379> TS.ADD temperature:3:11 1548149191 42
OK
127.0.0.1:6379>  TS.RANGE temperature:3:11 1548149180 1548149210 AGGREGATION avg 5
1) 1) (integer) 1548149180
   2) "30"
2) 1) (integer) 1548149190
   2) "42"

Client libraries

Some languages have client libraries that provide support for RedisTimeSeries commands:

Project Language License Author URL
JRedisTimeSeries Java BSD-3 RedisLabs Github
redistimeseries-go Go Apache-2 RedisLabs Github
redistimeseries-py Python BSD-3 RedisLabs Github

Tests

Tests are written in python using the rmtest library.

$ cd src
$ pip install -r tests/requirements.txt # optional, use virtualenv
$ make tests

Documentation

Read the docs at http://redistimeseries.io

Mailing List / Forum

Got questions? Feel free to ask at the RedisTimeSeries mailing list.

License

Redis Source Available License Agreement, see LICENSE

You can’t perform that action at this time.