From: Nirgal Date: Wed, 16 Oct 2019 10:35:42 +0000 (+0000) Subject: Tests on php-rrd not using rrdcahed X-Git-Url: https://git.nirgal.com/?p=ampy.git;a=commitdiff_plain;h=56c303e71cdd2e4fe90c14c370479c46e1f157a5 Tests on php-rrd not using rrdcahed --- diff --git a/html/ampy.inc.php b/html/ampy.inc.php index 050319f..a99f7ac 100644 --- a/html/ampy.inc.php +++ b/html/ampy.inc.php @@ -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 diff --git a/html/lastupdate.php b/html/lastupdate.php index 74a9479..b5b58a1 100644 --- a/html/lastupdate.php +++ b/html/lastupdate.php @@ -4,6 +4,16 @@