Influxdb: Should support moving averages aggregate function

Created on 23 Nov 2013  Â·  89Comments  Â·  Source: influxdata/influxdb

Should be able to calculate moving averages of different types. Simple, weighted, exponential, etc. Need to come up with specific syntax and stuff, but for now there's more reading here http://en.wikipedia.org/wiki/Moving_average

arefunctions kinfeature-request

All 89 comments

:+1: EMA functions would be great!

Comments from #396 (which is a duplicate of this issue)

It would be great to have Influx calculate a (simple) moving average (or median, or maybe even percentiles).

For example: SELECT movingAverage(value, $window) FROM my_series, where $window could be a number of points/events, or a time interval, like 1s or 2m.

+1

+1

+1

+1

+1

+1

+1

+1

+1, really need this. Should we think about it together?

+1 but as a downsampled continuous queries

select mavg(val) from temp_series group by time(1h) into temp_series.mavg.1h

+1

+1

+1

+1

+1

+1

+1

I'd really like to have a go at this (and Holt winters forecasting). CQ seems the right way of doing these. They'd need access previous buckets/periods. Any tips would be appreciated. I'll start having a dig around

+1

window functions give the simple moving average for free and they are a really nice feature (http://www.postgresql.org/docs/9.4/static/tutorial-window.html).

haven't seen a database that provides EMA out of the box. usually it's a user defined function.

:+1:

+1

+1, moving average is something we would also appreciate.

Our use case is having metrics of raw monitoring data, let's say every minute pushing:

memory.<hostname>
  free: <free_bytes>
  total: <total_memory_bytes>

I was trying to have continuous query for pctFree_memory.

select (free * 100.0 / total) from /^memory\./ into pctFree_:series_name

This one on it's own does not work (the historical values are calculated but new ones are propagated with free and total; the calculated value is not there).

On the other note I was trying something like:

select mean(free * 100.0 / total) as pctFreeAvg5m from /^memory\./ where (time > now() - 5m) AND (time < now()) into pctFreeAvg5m_:series_name

But this one also does not work.

Can you perhaps point me into a right direction if such metrics are possible directly with continuous queries at all?

+1 on this. One way mentioned on this page is

select mavg(val) from temp_series group by time(1h) into temp_series.mavg.1h

but that only gives a downsampled average, not a moving average. Does anyone have leads on this?

+1

+1

+1

+1

+1

+1

+1

+1

+1

++

+1

+1

++

+1

+1

+1

+1 :-)

+1
This is a useful function in Graphite, I need it in influxdb also.

+1

bump

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

+2

+1

+1

+1

+1

+1

+1

+1

+1

+1

+1

:+1:

+1

+1

+1

+1

+1

unsubscribe
On Mar 1, 2016 11:24 AM, "Julien Maitrehenry" [email protected]
wrote:

+1

—
Reply to this email directly or view it on GitHub
https://github.com/influxdata/influxdb/issues/77#issuecomment-190820693.

+1

unsubscribe

On Wed, Mar 2, 2016 at 3:49 PM, Jeff Schumacher [email protected]
wrote:

+1

—
Reply to this email directly or view it on GitHub
https://github.com/influxdata/influxdb/issues/77#issuecomment-191423281.

@mbalkanloo that's not how you unsubscribe to an issue. You're adding more noise whenever you send that email. Follow the link to GH and unsubscribe to the issue using their interface.

+1

+1

As mentioned in my post to the mailing list we are experimenting with simplifying our open GitHub Issues. This feature request has been rolled into an aggregate issue for all function requests, so that we can close this issue until we are ready to work on it.

You may continue to make comments here. Closing the issue does not mean we are rejecting this idea.

I'll be making a new issue for each component of this issue. The simple moving average aggregate is in #6112 and we hope to be able to get that into 0.12.0, but no promises.

I'm reclosing this issue for now.

+1

+1

+1

+1

+1

+1

+1

We have implemented some moving average functions. If you need a moving average function that isn't included in the latest version, please open a new issue so we can triage the issue.

Thanks. I'm going to lock this conversation to prevent additional +1 comments.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

beckettsean picture beckettsean  Â·  105Comments

beckettsean picture beckettsean  Â·  44Comments

mvadu picture mvadu  Â·  60Comments

beckettsean picture beckettsean  Â·  43Comments

TechniclabErdmann picture TechniclabErdmann  Â·  80Comments