Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS Range multiple value buckets for aggregate . #17

Open
borgrodrick opened this issue Jun 16, 2020 · 1 comment
Open

TS Range multiple value buckets for aggregate . #17

borgrodrick opened this issue Jun 16, 2020 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@borgrodrick
Copy link

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
84792605-561f6300-aff4-11ea-8546-b889f08499f0

result in redisinsight
84792754-8b2bb580-aff4-11ea-8874-0ca683365db4

Sample repo having : JRedisTimeSeriesUserDepositTest class replicating issue above .

https://github.com/borgrodrick/JRedisTimeSeries.git

@gkorland
Copy link
Contributor

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 

@gkorland gkorland added the help wanted Extra attention is needed label Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants