Pre-release demo version
[ampy.git] / readme
diff --git a/readme b/readme
index 75c0776af1fd8566acd0de865ee2473692090a41..9defae2a2b0cf0a5417eb5eea3820d951f36884d 100644 (file)
--- a/readme
+++ b/readme
@@ -1,3 +1,21 @@
 https://learn.openenergymonitor.org/electricity-monitoring/ct-sensors/yhdc-sct-013-000-ct-sensor-report
 
-rrdtool create power.rrd --start now-2h --step 1s DS:watts:GAUGE:1:0:6600 RRA:AVERAGE:0.5:1s:1d  # Buggy: nécessite des updates toutes les 500 ms
+rrdtool create power.rrd --step 1s DS:watts:GAUGE:1:0:6600 RRA:AVERAGE:0.5:1s:1d  # Buggy: nécessite des updates toutes les 500 ms
+rrdtool create power.rrd --daemon /var/run/rrdcached.sock --step 1s DS:watts:GAUGE:1:0:6600 RRA:AVERAGE:0.5:1s:1d  # Buggy: nécessite des updates toutes les 500 ms
+
+rrdtool create /var/lib/rrdcached/db/power.rrd \
+       --step 1s \
+       DS:watts:GAUGE:1s:0:10000 \
+       RRA:AVERAGE:0.5:1s:1d \
+       RRA:AVERAGE:0.5:1m:3d \
+       RRA:AVERAGE:0.5:15m:1w \
+       RRA:AVERAGE:0.5:1h:30d \
+       RRA:AVERAGE:0.5:1d:3y \
+       RRA:MAX:0.5:1d:3y \
+       RRA:AVERAGE:0.5:1month:10y \
+       RRA:MAX:0.5:1month:10y
+
+Ceci n'est pas rafraîchi très souvent:
+watch -n 0.5 rrdtool graphv - '-s' '1546280606' 'DEF:watts=/var/lib/rrdcached/db/power.rrd:watts:AVERAGE' 'VDEF:avg=watts,AVERAGE' 'VDEF:last=watts,LAST' 'PRINT:avg:%lf' 'PRINT:last:%lf'
+Alors que ça si:
+watch -n 0.5 rrdtool lastupdate --daemon /var/run/rrdcached.sock /var/lib/rrdcached/db/power.rrd