[rrd-users] Re: "Smoothing" a graph
andre at online.ee
Sat Feb 10 01:07:29 MET 2001
I've just tried to implement a "moving average" with graph, and it
seems to work pretty nicely. I got the idea from how cisco is doing
average load calculations http://www.cisco.com/warp/public/66/3.html
This allows you to smooth spikes on graphs, fill in gaps in missing
data, and add a "trend" lines to your graphs.
By playing with weight factor you can nearly any "smoothness" desired.
(hope I just didn't reinvent a wheel ;)
new-mavg = ( (last-mavg - datasample) * weight + datasample
rrdtool graph $png -a PNG \
-h 400 \
-w 1000 \
--base 1000 \
-s -7week \
"LINE1:inp2#FF0000:Max values\n" \
"LINE3:mavg#0000FF:Moving average, weight $weight"
> From: Phil Henningsen <PhilH at astrology.com>
> I have an RRDatabase that saves five ABSOLUTE variables (MIN, MAX &
> AVERAGE) with readings taken at 5 minute intervals. Two of the variables
> are "sparse and bunched". For example, the 6 readings over 30 minutes
> might look like: 0, 10, 0, 12, 2, 8.
> This causes the "two day" chart (where the horizontal grid lines are 1 hour
> apart) to look like a seismograph during an earthquake. That is, the lines
> are very jagged over a wide range.
> Is there any way, while graphing, that I can use an average "as if" it were
> sampled over a longer interval, thereby smoothing the graph? That is, in
> the example above, the total over 30 minutes is 32, and I would like the
> graph to treat it as if each of the 6 readings were 5.333 or at a rate of
> 1.0666 per minute.
> If I look at a two day interval way back in history, say 6 months ago, the
> charts have the "smoothed" effect that I would like to achieve in the
> current period.
> Thanks for your assistance.
Andres Kroonmaa <andre at online.ee>
Tel: 6501 731, Fax: 6501 708
Pärnu mnt. 158, Tallinn,
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
More information about the rrd-users