[rrd-users] Accessing time interval for data elements, within CDEF construct

Bryan gruvin at gmail.com
Sat May 18 08:08:39 CEST 2013


Hi.

I am new to rrdtool and been pawing over the documentation for a couple day
now. It's mostly all making sense, but I need a little help with some finer
details ...

I have the following two lines in an rrdtool graph script ...

  DEF:in=traffic.rrd:bw_in:AVERAGE:step=300
  CDEF:tot_in=PREV,in,300,*,ADDNAN

The goal is to multiply each sample (is that the right word?) by its time
interval to get back to the raw count of octets logged, then add that
result to the previous result, so as to end up with accumulated totals,
over time.
*
There are two possible problems with this method, for which I am here
seeking clarity. *

*1.* Is PREV really returning the previous result or is it merely giving
the previous raw sample value (without the multiplication in*300 having
been done)? Perhaps I should rather do something like, ...

  CDEF:tot_in=PREV,300,*,in,300,*,ADDNAN ?

*2.* It seems not a good idea to hard code the 300, though the addition of
:step=300 in the DEF statement should protect me, I think?

I cannot find any 'special value' in the documentation to get around hard
coding the 300. I was rather hoping for something like ..

  CDEF:tot_in=PREV,in,*TI*,*,ADDNAN

... where *TI* would be the time interval, in seconds, relating to the
sample ('in' array data item) being processed.

At present, it seems we can only access the *rate value* or the
*timestamp*(using TIME) of of each data item in a data 'array', but
not the time
interval length for which the item applies. Yes? No?

- - - -

Am I correct in my assertions or am I missing something(s)?

Is this *TI special value* thing a good idea for a new feature or is it
redundant, somehow?

Please help me to understand better. :-P

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130518/c42621d7/attachment.htm 


More information about the rrd-users mailing list