How to calculate avg on time series data

30 views
Skip to first unread message

Tuan Anh Tran

unread,
Jun 12, 2018, 1:54:13 AM6/12/18
to Redis DB
i have data that looks like this

item id | timestamp | value

I would like to get avg values between from timestamp and to timestamp

Is it possible with redis?

Tuan Anh Tran

unread,
Jun 12, 2018, 1:55:24 AM6/12/18
to Redis DB
Also, is it possible to sort item id base on avg values over a certain timestamp?

Itamar Haber

unread,
Jun 12, 2018, 8:11:11 AM6/12/18
to Redis DB
Hello Tuan,

I believe what you're trying to do is possible with Redis. Pointers:

* Look into modeling the data using a Sorted Set or Streams (v5)
* Averages and sorting can be implemented with a Lua script

Cheers,

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber
Technicalist Evangenly

Phone: +972.54.567.9692

Redis Labs


Tuan Anh Tran

unread,
Jun 13, 2018, 6:57:27 AM6/13/18
to redi...@googlegroups.com
Thanks. I got it working w sorted setnow
On Tue, Jun 12, 2018 at 7:11 PM Itamar Haber <ita...@redislabs.com> wrote:
Hello Tuan,

I believe what you're trying to do is possible with Redis. Pointers:

* Look into modeling the data using a Sorted Set or Streams (v5)
* Averages and sorting can be implemented with a Lua script

Cheers,
On Tue, Jun 12, 2018 at 8:55 AM, Tuan Anh Tran <m...@tuananh.org> wrote:
Also, is it possible to sort item id base on avg values over a certain timestamp?


On Tuesday, June 12, 2018 at 12:54:13 PM UTC+7, Tuan Anh Tran wrote:
i have data that looks like this

item id | timestamp | value

I would like to get avg values between from timestamp and to timestamp

Is it possible with redis?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.

To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber
Technicalist Evangenly

Phone: +972.54.567.9692

Redis Labs


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages