I'm playing with RRDTool, but it shows wrong values. I have little python script:
import sys
import rrdtool
import time
i = 0
rrdtool.create(
'tempo.rrd',
'--step', '10',
'DS:temp:GAUGE:20:-40:100',
'RRA:LAST:0.5:1:1500'
)
while 1:
ret = rrdtool.update('tempo.rrd','N:' + `i`);
print "i %i" % i
rrdtool.graph(
'test.png',
'--imgformat', 'PNG',
'--width', '540',
'--height', '200',
'--start', "-%i" % 60,
'--end', "-1",
'--vertical-label', 'Temperatura',
'--title', 'Temperatura lauke',
'--lower-limit', '-1',
'DEF:actualtemp=tempo.rrd:temp:LAST',
'LINE1:actualtemp#ff0000:Actual',
'GPRINT:actualtemp:LAST:Actual %0.1lf C'
)
i += 1
time.sleep(10)
After inserting [0, 1, 2], I get graph with wrong values - https://i.stack.imgur.com/J4fM1.png (sorry, I can't post images). As you see, after inserting 0, graph shows 0, after inserting 1, graph shows 0.8 and after inserting 2, graph shows 1.8. Sometimes after inserting 1, graph shows 0.6 and so on. Am I doing something wrong?