# HG changeset patch # User Matt Johnston # Date 1340465821 -28800 # Node ID 03322c38b4a98e54798e94b87f0b11be7e1249ba # Parent d6219df77c41b3b3f113a3aab822be7203508179 Create with a start date so that it works diff -r d6219df77c41 -r 03322c38b4a9 web/log.py --- a/web/log.py Sat Jun 23 22:10:23 2012 +0800 +++ b/web/log.py Sat Jun 23 23:37:01 2012 +0800 @@ -21,10 +21,15 @@ for r in glob.glob('%s/*.rrd' % config.DATA_PATH)] def create_rrd(sensor_id): - rrdtool.create(sensor_rrd_path(sensor_id), '-s', '300', - 'DS:temp:GAUGE:600:-10:100', - 'RRA:AVERAGE:0.5:1:1051200') + # start date of 10 seconds into 1970 is used so that we can + # update with prior values straight away. + args = [sensor_rrd_path(sensor_id), + '--start', '10', + '--step', '300', + 'DS:temp:GAUGE:600:-10:100', + 'RRA:AVERAGE:0.5:1:1051200'] + rrdtool.create(*args) # stolen from viewmtn, stolen from monotone-viz def colour_from_string(str): @@ -56,6 +61,7 @@ '--slope-mode', '--border', '0', '--color', 'BACK#ffffff', + '--alt-y-grid', '--imgformat', 'PNG'] \ + graph_args if config.GRAPH_FONT: