Thanks, Simon<div><br></div><div>We're getting close to the solution, however I don't like how this forces me to manually handle step calculation.</div><div>It complicates my software significantly - up to now I could rely on rrdtool handling the step and date ranges.</div>
<div><br></div><div>Best regards,</div><div>RG</div><div><br></div><div><br><div class="gmail_quote">On Sun, May 20, 2012 at 5:44 PM, Simon Hobson <span dir="ltr"><<a href="mailto:linux@thehobsons.co.uk" target="_blank">linux@thehobsons.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Rafal Gwizdala wrote:<br>
>Whoa, not so fast. TOTAL is available for VDEF only so I can<br>
>calculate the total for the whole graph only. Still don't see a way<br>
>to do the same for each aggregation step shown on the graph.<br>
<br>
</div>If your step period for the graph is (say) 1800s, then do :<br>
x=a,1800,*<br>
where a is your stored rate, and then plot x.<br>
<div class="im"><br>
>If there was some variable representing graph's time resolution I<br>
>could use it for calculating sums the way you described<br>
>CDEF:total=myvalue,GRAPHRESOLUTIONSECS,*<br>
<br>
</div>There is, but you need to work it out before you call the graph. When<br>
I do graphs, I work out what resolution I'm going to plot and work<br>
from there. So I tend to do something like :<br>
case period in<br>
day<br>
step=300; time=86400 ;;<br>
week<br>
step=1800; time=604800 ;;<br>
...<br>
<br>
Then I work out start and end times :<br>
e=`date +%s`<br>
end=$(( ${e} / ${step} * ${step} ))<br>
start=$(( ${end} - ${time} ))<br>
<br>
So in Bash, $end is now the exact time at the end of the last<br>
complete period, and $start is that time less the length of the graph.<br>
<br>
I can now use "--start ${start} --end ${end}" in the graph<br>
definition, and of course, you can also use $step in calculations :<br>
x=a,${step},*<br>
for example.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Simon Hobson<br>
<br>
Visit <a href="http://www.magpiesnestpublishing.co.uk/" target="_blank">http://www.magpiesnestpublishing.co.uk/</a> for books by acclaimed<br>
author Gladys Hobson. Novels - poetry - short stories - ideal as<br>
Christmas stocking fillers. Some available as e-books.<br>
<br>
_______________________________________________<br>
rrd-users mailing list<br>
<a href="mailto:rrd-users@lists.oetiker.ch">rrd-users@lists.oetiker.ch</a><br>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users</a><br>
</div></div></blockquote></div><br></div>