<div dir="ltr"><div>Hi. <br><br>I am new to <span style="font-family:courier new,monospace">rrdtool</span> and been pawing over the documentation for a couple day now. It&#39;s mostly all making sense, but I need a little help with some finer details ...<br>
<br>I have the following two lines in an rrdtool graph script ... <br><br><span style="font-family:courier new,monospace">  DEF:in=traffic.rrd:bw_in:AVERAGE:step=300 <br>  CDEF:tot_in=PREV,in,300,*,ADDNAN </span><br><br>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. <br>
<b><br>There are two possible problems with this method, for which I am here seeking clarity. </b><br><br><b>1.</b> 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, ...<br>
<br><span style="font-family:courier new,monospace">  CDEF:tot_in=PREV,300,*,in,300,*,ADDNAN </span>?<br><br></div><div><b>2.</b> It seems not a good idea to hard code the 300, though the addition of <span style="font-family:courier new,monospace">:step=300</span> in the DEF statement should protect me, I think? <br>
<br>I cannot find any &#39;special value&#39; in the documentation to get around hard coding the 300. I was rather hoping for something like .. <br><br><span style="font-family:courier new,monospace">  CDEF:tot_in=PREV,in,<b>TI</b>,*,ADDNAN <br>
</span><br>... where <i>TI</i> would be the time interval, in seconds, relating to the sample (&#39;in&#39; array data item) being processed.<br>  <br>At present, it seems we can only access the <i>rate value</i> or the <i>timestamp</i> (using TIME) of of each data item in a data &#39;array&#39;, but not the time interval length for which the item applies. Yes? No?<br>
<br>- - - -<br><br>Am I correct in my assertions or am I missing something(s)?<br><br>Is this <i>TI special value</i> thing a good idea for a new feature or is it redundant, somehow?<br><br>Please help me to understand better. :-P <br>
<br>Thank you. <br></div></div>