Tests on php-rrd not using rrdcahed
[ampy.git] / html / ampy.inc.php
index 050319f53c7db4fa051cf141fbcb21beea6a5b62..a99f7acb6526a331672fe183f2b89a44892d28a8 100644 (file)
@@ -79,6 +79,21 @@ function ampy_get_counter() {
        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