[rrd-users] How to calculate desired value?

Simon Hobson linux at thehobsons.co.uk
Sat Aug 23 16:06:46 CEST 2014


spock <collector at sappers.de> wrote:

> I tried:
> 	CDEF:heattime2=heat_flag,900,*,60,/ \
> 	VDEF:totalheattime=heattime2,AVERAGE'
> 	GPRINT:totalheattime:"Total\: %2.2lf h \n"'
> but I get wrong results. I probably have to do the calculation completly
> different.
> 
> Can anyone help me out here?
> 
> I should get perfectly aligned values as a result: 0.25 h; 0.50h; etc.
> How can I achieve this?

Give us a clue to go on, what values do you get ?
Is it that you expected (say) 15 but got 14.99, or you got something completely different ?
Your approach is right, I suspect rounding errors come into it.



More information about the rrd-users mailing list