From 7070ac531abed5c2e6122c8ee7d0b677d3eeef96 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 10 Dec 2019 20:22:57 +1000 Subject: Clean up the graph a bit. --- apt-panopticon-report-email-web.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index b291e44..6319d1e 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua @@ -268,15 +268,25 @@ count = 1 for k, v in APT.orderedPairs(mirrors) do if 'deb.devuan.org' ~= k then local c = colours[count] + local name = string.format('%32s', k) if 'pkgmaster.devuan.org' == k then c = 'ffffff' end - table.insert(g, 'DEF:speed' .. count .. '=rrd/' .. k .. '/HTTP/Speed.rrd:max:LAST') - table.insert(g, 'VDEF:vspeed' .. count .. '=speed' .. count .. ',AVERAGE') - table.insert(g, 'LINE2:speed' .. count .. '#' .. c .. ':' .. k .. '\t') - table.insert(g, 'GPRINT:vspeed' .. count .. ':%5.1lf%s\\l') + table.insert(g, 'DEF:speedn' .. count .. '=rrd/' .. k .. '/HTTP/Speed.rrd:max:MIN') + table.insert(g, 'DEF:speedx' .. count .. '=rrd/' .. k .. '/HTTP/Speed.rrd:max:MAX') + table.insert(g, 'DEF:speeda' .. count .. '=rrd/' .. k .. '/HTTP/Speed.rrd:max:AVERAGE') + table.insert(g, 'DEF:speedl' .. count .. '=rrd/' .. k .. '/HTTP/Speed.rrd:max:LAST') + table.insert(g, 'VDEF:vspeedn' .. count .. '=speedn' .. count .. ',AVERAGE') + table.insert(g, 'VDEF:vspeedx' .. count .. '=speedx' .. count .. ',AVERAGE') + table.insert(g, 'VDEF:vspeeda' .. count .. '=speeda' .. count .. ',AVERAGE') + table.insert(g, 'VDEF:vspeedl' .. count .. '=speedl' .. count .. ',AVERAGE') + table.insert(g, 'LINE2:speedx' .. count .. '#' .. c .. ':' .. name .. ' ') + table.insert(g, 'GPRINT:vspeedn' .. count .. ':Min %5.1lf%s,') + table.insert(g, 'GPRINT:vspeeda' .. count .. ':Avg %5.1lf%s,') + table.insert(g, 'GPRINT:vspeedx' .. count .. ':Max %5.1lf%s,') + table.insert(g, 'GPRINT:vspeedl' .. count .. ':Last %5.1lf%s\\l') count = count + 1 end end -APT.rrd.graph('results/speed.png', '--start', 'now-2w', '--end', 'now', '-t', 'Speed', '-v', 'bytes per second', '-w', '900', '-h', '400', '-Z', +APT.rrd.graph('results/speed.png', '--start', 'now-2w', '--end', 'now', '-t', 'Speed, rough maximum guess.', '-v', 'bytes per second', '-w', '900', '-h', '400', '-Z', '-c', 'BACK#000000', '-c', 'CANVAS#000000', '-c', 'FONT#FFFFFF', '-c', 'AXIS#FFFFFF', '-c', 'FRAME#FFFFFF', '-c', 'ARROW#FFFFFF', unpack(g)) -- cgit v1.1