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

Average in DuplicatePolicyType #112

Open
Shriram-RP opened this issue Nov 11, 2021 · 3 comments
Open

Average in DuplicatePolicyType #112

Shriram-RP opened this issue Nov 11, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@Shriram-RP
Copy link

Is there a way we can get the average value for a particular timestamp of a time series key in redis time series.
We are currently recording latency and recording them in milliseconds timestamp and there could be 2 values in same timestamp slot.

We want to know the average stored here and not the sum/max. Also, there seems to be no way to store data in a linkedlist format for a certain timestamp.

The only way to do now is to go for nanoseconds timestamp but that would mean having too much data stored in a time series key. Is there a way where we could address this problem like a average duplicatepolicytype?

@gkorland
Copy link
Contributor

gkorland commented Nov 11, 2021

Average is trickier since it requires saving 2 numbers: count & average/sum.

BTW, such request should be opened here: https://github.com/RedisTimeSeries/RedisTimeSeries/issues

@gkorland gkorland added the enhancement New feature or request label Nov 11, 2021
@Shriram-RP
Copy link
Author

@gkorland

Is there anyways where we can store a list of values at a particular timestamp in time series?

@gkorland
Copy link
Contributor

Do you expect it to happen frequently? Do you expect cases of more than two events in the same timestamp?

If it's rare to have any collisions, perhaps you should not enable any Duplicate_Policy and in case of collision do the average on the client side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants