9951 explained code solutions for 126 technologies


redis-timeseriesTime series aggregation example


You can create special aggregation rules for time series keys to compress them based on bigger ranges (to save data):

redis-cli TS.CREATE ats_2
redis-cli TS.CREATERULE ts_2 ats_2 AGGREGATION sum 60000ctrl + c
redis-cli

redis executable with RedisTimeSeries module installed

TS.CREATE ats_2

create ats_2 time series that will be used for aggregated data from ts_2

TS.CREATERULE

crates aggregation rule

ts_2 ats_2

save aggregated data from ts_2 key to ats_2 key

AGGREGATION

specify aggregation options

sum

aggregation function to use (list of supported functions)

60000

timebucket to aggregate on in milliseconds (60 seconds in our case)