I am trying to wrap my head around how Redis' timeseries rule creation works, and I was confused why Redis ignores the last item in an aggregation, and wondering if that is expected behaviour.
I have created a sample code in redis-cli to illustrate:
127.0.0.1:6379> FLUSHALL
OK
127.0.0.1:6379> TS.CREATE source
OK
127.0.0.1:6379> TS.CREATE sumRule
OK
127.0.0.1:6379> TS.CREATERULE source sumRule AGGREGATION sum 1
OK
127.0.0.1:6379> TS.ADD source * 1
(integer) 1592638841406
127.0.0.1:6379> TS.ADD source * 2
(integer) 1592638843446
127.0.0.1:6379> TS.ADD source * 3
(integer) 1592638846536
127.0.0.1:6379> TS.ADD source * 4
(integer) 1592638849085
127.0.0.1:6379> TS.GET sumRule
1) (integer) 1592638846536
2) 3
I expected here the last item to be 4 not 3. Is this expected behaviour, because it needs to look backwards to make aggregations? Or does it require more than one value to make the aggregation?