JRedisTimeSeries
JRedisTimeSeries copied to clipboard
TS Range multiple value buckets for aggregate .
I am using redis version 6.0.1 running via docker (docker run -p 6379:6379 -it --rm redislabs/redistimeseries)
I am trying to get an daily sum aggregate of values on a given key via:
rts.range(key, LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.ofHours(2)).toEpochMilli(),LocalDateTime.now().toInstant(ZoneOffset.ofHours(2)).toEpochMilli(), Aggregation.SUM, 863400000);
The result is an array having 2 values. This is different from running the same TS.RANGE command directly via redis which will produce only a single data value.
Below screenshot shows values in intelij
result in redisinsight
Sample repo having : JRedisTimeSeriesUserDepositTest class replicating issue above .
https://github.com/borgrodrick/JRedisTimeSeries.git
I ran the Java test and from redis-cli and got the same results.
24hrs Key: deposit Value: 6.0
24hrs Key: deposit Value: 17.0
Daily sum is : 23.0
JedisPool: Active=0, Idle=0, Waiters=0, total=0, maxTotal=100, minIdle=8, maxIdle=0
1) 1) (integer) 1592179200000
2) 6
2) 1) (integer) 1592265600000
2) 17
127.0.0.1:6379>
I suggest you run the following while running the java test to see that is sent to the server.
redis-cli monitor