return $counter;
}
+/*
+ * Experimental function that uses rrd_graph to get lastest information
+ * This actually flushes the daemon... so it doesn't work
+ *
+function my_lastupdate_noflush() {
+ $info=rrd_graph( '-',
+ '--daemon', RRDSOCK,
+ 'DEF:watts='.RRDFILE.':watts:AVERAGE',
+ '-s' 'now - 5 seconds',
+ 'DEF:watts=/var/lib/rrdcached/db/power.rrd:watts:AVERAGE',
+ 'VDEF:last=watts,LAST',
+ 'PRINT:last:%lf'
+ );
+} */
+
/*
* Return all the information.
* Make sure you call ampy_flush_rrd_daemon() first if you need real time