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

movingAverage / movingMedian parameter type #1207

Closed
nikut opened this issue Dec 9, 2014 · 3 comments
Closed

movingAverage / movingMedian parameter type #1207

nikut opened this issue Dec 9, 2014 · 3 comments

Comments

@nikut
Copy link
Contributor

nikut commented Dec 9, 2014

The movingAverage and movingMedian functions in Graphite can both take either an int argument to define the window size in samples or a string argument to define the window size as a time period (e.g. '10m'). For some reason Grafana only supports the latter for movingMedian and the former for movingAverage.

It is possible to enter a time period for movingAverage by manually putting it in quotes (e.g. movingAverage('10m')) but the editor will remove the quotes at some point so it becomes movingAverage(10m), breaking the syntax. On the other hand, it is impossible to enter a window size in samples for movingMedian as the editor forces the quotes there (e.g. movingMedian('10')), which again breaks the syntax.

Not sure what's the best way to fix this. I would vote for making both functions behave the same way as movingMedian currently does (ie. take a string parameter) as it makes more sense to me to define the window size as a time period, but I suppose some people may disagree. Is there a way to add support for both formats?

Test cases (all four should work according to http://graphite.readthedocs.org/en/latest/functions.html#graphite.render.functions.movingAverage):

  1. movingAverage(10) => works, window size of 10 samples
  2. movingAverage('10m') => works initially, syntax error eventually as the editor turns it into movingAverage(10m)
  3. movingMedian(10) => syntax error
  4. movingMedian(10m) => works, window size of 10 minutes (gets turned into movingMedian('10m') automatically)
@torkelo
Copy link
Member

torkelo commented Dec 11, 2014

Thanks for reporting this, will investigate

@torkelo torkelo added this to the 1.9.1 milestone Dec 15, 2014
@torkelo
Copy link
Member

torkelo commented Dec 15, 2014

Fixed!

@nikut
Copy link
Contributor Author

nikut commented Dec 15, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants