For this quick start, you will need the following:

Create a new database that uses the Module

  1. In the Redis Modules field, click Add.
  2. Select the RedisTimeSeries module.
  3. If you want the module to use a custom configuration, click Add configuration and enter the optional custom configuration.
  4. Click Save.

    For example:

  5. Click the Activate button

Quick start with redis-cli

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 aggregation rule.

With redis-cli

Connect to redis.

$ redis-cli -p 12543
127.0.0.1:12543>

Run these commands:

127.0.0.1:12543> TS.CREATE temperature RETENTION 60 LABELS sensor_id 2 area_id 32
OK
127.0.0.1:12543> TS.ADD temperature:3:11 1548149181 30
OK
127.0.0.1:12543> TS.ADD temperature:3:11 1548149191 42
OK
127.0.0.1:12543>  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