aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-email-web.lua
diff options
context:
space:
mode:
authoronefang2019-12-10 15:47:45 +1000
committeronefang2019-12-10 15:47:45 +1000
commit86a89a372ec2c09894d5fa7bc1fff2421f484a88 (patch)
treed8ebbd381aeb5ebef1f2b22927bba98b3bdee79b /apt-panopticon-report-email-web.lua
parentTypo-- (diff)
downloadapt-panopticon-86a89a372ec2c09894d5fa7bc1fff2421f484a88.zip
apt-panopticon-86a89a372ec2c09894d5fa7bc1fff2421f484a88.tar.gz
apt-panopticon-86a89a372ec2c09894d5fa7bc1fff2421f484a88.tar.bz2
apt-panopticon-86a89a372ec2c09894d5fa7bc1fff2421f484a88.tar.xz
Add RRD data collection, and a speed graph.
Diffstat (limited to 'apt-panopticon-report-email-web.lua')
-rwxr-xr-xapt-panopticon-report-email-web.lua51
1 files changed, 51 insertions, 0 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index ef61183..7d4b0fc 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -231,6 +231,57 @@ if nil == email then C("opening mirrors file - " .. e) else
231end 231end
232 232
233 233
234local colours =
235{
236 'f0000080',
237 '0f000080',
238 '00f00080',
239 '000f0080',
240 '0000f080',
241 '00000f80',
242 '80000080',
243 '08000080',
244 '00800080',
245 '00080080',
246 '00008080',
247 '00000880',
248 'ff000080',
249 '0ff00080',
250 '00ff0080',
251 '000ff080',
252 '0000ff80',
253 '88000080',
254 '08800080',
255 '00880080',
256 '00088080',
257 '00008880',
258}
259local g = {}
260local count = 0
261for k, v in APT.orderedPairs(mirrors) do
262 if 'pkgmaster.devuan.org' ~= k then count = count + 1 end
263end
264for i = 1, count do
265end
266
267count = 1
268for k, v in APT.orderedPairs(mirrors) do
269 if 'deb.devuan.org' ~= k then
270 local c = colours[count]
271 if 'pkgmaster.devuan.org' == k then c = 'ffffff' end
272 table.insert(g, 'DEF:speed' .. count .. '=rrd/' .. k .. '/HTTP/Speed.rrd:max:LAST')
273 table.insert(g, 'VDEF:vspeed' .. count .. '=speed' .. count .. ',AVERAGE')
274 table.insert(g, 'LINE2:speed' .. count .. '#' .. c .. ':' .. k .. '\t')
275 table.insert(g, 'GPRINT:vspeed' .. count .. ':%5.1lf%s\\l')
276 count = count + 1
277 end
278end
279APT.rrd.graph('results/speed.png', '--start', 'now-1w', '--end', 'now', '-t', 'Speed', '-v', 'bytes per second', '-w', '900', '-h', '400', '-Z',
280'-c', 'BACK#000000', '-c', 'CANVAS#000000', '-c', 'FONT#FFFFFF', '-c', 'AXIS#FFFFFF', '-c', 'FRAME#FFFFFF', '-c', 'ARROW#FFFFFF',
281unpack(g))
282
283
284
234results = {} 285results = {}
235m = {} 286m = {}
236faulty = "" 287faulty = ""