Feature request: central moving average


#1

I would like to visualize my data with Grafana including a central moving average graph.
I’m aware about the moving_average(n) function, but the delay of the graph is annoying to me.
Is there a way to “left” shift the moving average graph by n/2 samples?
Or is there a centralised moving average function implemented?

Thank you in advance,
TriCX


#2

I do have the exact same question I think - I want to show some averaged out numbers (charts, lines) that provide a hint how some measurement are changing in general, i.e. smoothed out, but max/min at the correct timestamps. There is moving_average function, but it’s shifted to later times (to the right) - the moving_average() function takes the past individual measurements to calculate the average at a given time.

In a picture:
Grafana%20Screenshot

Since it would be more useful (at least for me) to understand at what time a measurement is e.g. maximal I would like to have something like a centered_moving_average function. From a mathematical viewpoint that function would take n/2 measurements to the left and n/2 to the right at a given point to calculate the average.

In the example (graph) shown above I would like to see the moving_average() showing the maximum around 12:00 (at which time the actual measurement was really showing the maximum).

Is there such a function around or possibly a simple kind of ‘shift’ to the moving_average() query that I overlooked?