[rrd-users] Is is possible to get short term average directly in RRD tool ?

Didier di07s at yahoo.fr
Sun May 2 10:34:21 MEST 2004

Is is possible to get short term average directly in RRD tool ?


    I'm using the RRD Tool through the frontend  JFF NMS application.
    I would like to have in my graph a curve which represent a "short term value" of a RRD Data Source.

    By "short term value" I want to have a curve for which each point is computed from the "20 last minutes" of the RRD Data Source,

    For example if we have  5 minutes  between   (t-1)  and  (t)     ==>  20 minutes represent 5 intervals of time 

           Data Source Value       v(t-7)      v(t-6)    v(t-5)     v(t-4)       v(t-3)     v(t-2)      v(t-1)         v(t)
           Short Term value            Nan      Nan      Nan        Nan        A         B           C            D

           With    A=average of  v(t-7), v(t-6) , v(t-5)  , v(t-4) , v(t-3)
                      B=average of  v(t-6), v(t-5)  , v(t-4) , v(t-3), v(t-2)
                      C=average of  v(t-5), v(t-4)  , v(t-3) , v(t-2), v(t-1)

     I have imagine a way, but it doesn't not optimize the resource of my computer, so I'm wondering this question because may be there is a more simple way to do it.
     In JFF NMS a data is appended to the RRD data base at each collect.

     So the way I have imagined is in pseudo code :

                   1)  Collect data and put in   "Data Source 1"  --->  RRD 1                                                            (So there is already a RRD file writing operation)
                   2)  Do   RRDTOOL fetch "average" on "Data Source 1"  with  -start=-1200    (which represents 20 minutes from current time)(a RRD file reading operation)
                   3)  Register result of previous "rrdtool" into another RRD 2                                                            (So there is a RRD file writing operation)

                    4) After to display the graph I can display curves for both the "current metric" (from RRD1) and for the "short terme average" (from RRD2)
                               (So there are reading of 2 RRD files)

      But may be it is possible to avoid the 2 last operations (2 and 3) by doing some computations directly in the   "rdtool graph".
      Has anybody an idea ?

 Thanks a lot for any suggestion.
 Best regards

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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list