[rrd-users] Re: rolling average
Serge Maandag
serge.maandag at staff.zeelandnet.nl
Thu Nov 17 14:36:42 MET 2005
> Is it possible to have a weighted average like eg. 0.5 val[t]+0.3
> val[t-1]+0.2 val[t-2] ?
Kind of, I use (val[t-1] - val[t]) * 0.93 + val[t].
I think I stole it from this list once.
By changing the weight factor 0.93, you can change how slow the line
responds.
Together with some catching of exceptions, it becomes something like:
DEF:val=/rrd/bla/..
CDEF:avg=PREV,UN,val,UN,1,val,IF,PREV,IF,val,UN,1,val,IF,-,0.93,*,val,UN
,1,val,IF,+
LINE1:val
LINE1:avg
So PREV has been replaced with:
IF (PREV=UN) {
val
} else {
PREV
}
and val has been replaced with:
IF (val==UN){
1
} else {
val
}
Serge.
-------------
Op de inhoud van dit e-mailbericht en de daaraan gehechte bijlagen is de inhoud van de volgende disclaimer van toepassing: http://www.zeelandnet.nl/disclaimer.php
-------------
For the content of this e-mail message and its attachment(s) the following disclaimer applies: http://www.zeelandnet.nl/disclaimer.php
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list