[rrd-users] How to calculate desired value?

spock collector at sappers.de
Fri Aug 22 19:20:53 CEST 2014


Hello,

I am currently working on a swimming pool control.
I store values every 15 min (precise timestamp; 16:15:00; 16:30:00; etc.)
and for every 15 min I store the "heat_flag", which is either "0" (heating
off) or "1" (heating on).

# rrdtool create temp_pool.rrd --step 900 --start "20140101 00:00" \
# DS:pump_flag:GAUGE:1200:0:1 \
# DS:heat_flag:GAUGE:1200:0:1 \
# DS:device:GAUGE:1200:0:90 \
# RRA:AVERAGE:0.5:1:103680 \
# RRA:MIN:0.5:96:3650 \
# RRA:MAX:0.5:96:3650 \
# RRA:AVERAGE:0.5:96:3650

I would like to calculate the total heating time per day.
For that, I would like to find the number of "1" values per day. 
In the end, multiply by 15min and I know the total heating time.

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?

Thanks a million,
spo



--
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/How-to-calculate-desired-value-tp7582375.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.



More information about the rrd-users mailing list