changeset 19:5bec78c876db

Properly re-arrange signal graph entries, show power.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 23 May 2016 11:52:50 +0930
parents ec994073f70a
children 38e3804d4f80
files adslstats.py
diffstat 1 files changed, 39 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/adslstats.py	Sun May 22 15:39:51 2016 +0930
+++ b/adslstats.py	Mon May 23 11:52:50 2016 +0930
@@ -219,28 +219,27 @@
         '--vertical-label', 'dB',
         '--slope-mode',
         '-l', '0',
+        '--font', 'LEGEND:7',
 
-        'DEF:nmup_=%s:nmup:AVERAGE' % rrdname,
-        'DEF:nmupmin_=%s:nmup:MIN' % rrdname,
-        'DEF:nmupmax_=%s:nmup:MAX' % rrdname,
+        'DEF:nmup=%s:nmup:AVERAGE' % rrdname,
+        'DEF:nmupmin=%s:nmup:MIN' % rrdname,
+        'DEF:nmupmax=%s:nmup:MAX' % rrdname,
 
-        'CDEF:nmup=nmup_,10,*',
-        'CDEF:nmupmin=nmupmin_,10,*',
-        'CDEF:nmupmax=nmupmax_,10,*',
         'CDEF:nmupdif=nmupmax,nmupmin,-',
 
         'LINE0:nmupmin#000000:',
         'AREA:nmupdif#5c5cff::STACK',
-        'LINE1:nmup#0000ff:Noise Margin - Up (1/10 dB)',
+        'LINE1:nmup#0000ff:Noise Margin - Up',
+
+        'DEF:nmdown=%s:nmdown:AVERAGE' % rrdname,
+        'DEF:nmdownmin=%s:nmdown:MIN' % rrdname,
+        'DEF:nmdownmax=%s:nmdown:MAX' % rrdname,
 
-        'DEF:nmdown_=%s:nmdown:AVERAGE' % rrdname,
-        'DEF:nmdownmin_=%s:nmdown:MIN' % rrdname,
-        'DEF:nmdownmax_=%s:nmdown:MAX' % rrdname,
+        'CDEF:nmdowndif=nmdownmax,nmdownmin,-',
 
-        'CDEF:nmdown=nmdown_,10,*',
-        'CDEF:nmdownmin=nmdownmin_,10,*',
-        'CDEF:nmdownmax=nmdownmax_,10,*',
-        'CDEF:nmdowndif=nmdownmax,nmdownmin,-',
+        'LINE0:nmdownmin#000000:',
+        'AREA:nmdowndif#009a00::STACK',
+        'LINE1:nmdown#00ff00:Noise Margin - Down',
 
         'DEF:attenup=%s:attenup:AVERAGE' % rrdname,
         'DEF:attenupmin=%s:attenup:MIN' % rrdname,
@@ -248,32 +247,40 @@
 
         'CDEF:attenupdif=attenupmax,attenupmin,-',
 
+        'LINE0:attenupmin#000000:',
+        'AREA:attenupdif#f98100::STACK',
+        'LINE1:attenup#ff0000:Attenuation - Up',
+
         'DEF:attendown=%s:attendown:AVERAGE' % rrdname,
         'DEF:attendownmin=%s:attendown:MIN' % rrdname,
         'DEF:attendownmax=%s:attendown:MAX' % rrdname,
 
         'CDEF:attendowndif=attendownmax,attendownmin,-',
 
-        'DEF:powerup_=%s:powerup:AVERAGE' % rrdname,
-        'DEF:powerupmin_=%s:powerup:MIN' % rrdname,
-        'DEF:powerupmax_=%s:powerup:MAX' % rrdname,
-
-        'DEF:powerdown_=%s:powerdown:AVERAGE' % rrdname,
-        'DEF:powerdownmin_=%s:powerdown:MIN' % rrdname,
-        'DEF:powerdownmax_=%s:powerdown:MAX' % rrdname,
-
-
-        'LINE0:nmdownmin#000000:',
-        'AREA:nmdowndif#009a00::STACK',
-        'LINE1:nmdown#00ff00:Noise Margin - Down (1/10 dB)',
-
-        'LINE0:attenupmin#000000:',
-        'AREA:attenupdif#f98100::STACK',
-        'LINE1:attenup#ff0000:Attenuation - Up',
-
         'LINE0:attendownmin#000000:',
         'AREA:attendowndif#aaaaaa::STACK',
-        'LINE1:attendown#000000:Attenuation - Down')
+        'LINE1:attendown#000000:Attenuation - Down',
+
+        'DEF:powerup=%s:powerup:AVERAGE' % rrdname,
+        'DEF:powerupmin=%s:powerup:MIN' % rrdname,
+        'DEF:powerupmax=%s:powerup:MAX' % rrdname,
+
+        'CDEF:powerupdif=powerupmax,powerupmin,-',
+
+        'LINE0:powerupmin#000000:',
+        'AREA:powerupdif#804007::STACK',
+        'LINE1:powerup#ff800e:Power - Up (dBm)',
+
+        'DEF:powerdown=%s:powerdown:AVERAGE' % rrdname,
+        'DEF:powerdownmin=%s:powerdown:MIN' % rrdname,
+        'DEF:powerdownmax=%s:powerdown:MAX' % rrdname,
+
+        'CDEF:powerdowndif=powerdownmax,powerdownmin,-',
+
+        'LINE0:powerdownmin#000000:',
+        'AREA:powerdowndif#604872::STACK',
+        'LINE1:powerdown#c090e5:Power - Down (dBm)',
+        )
 
     rrdtool.graph("%s-hour-link.svg" % (graphbasename),
                   '--width', '768',