From 0560dc5975ff29be6d63885925aa1942135f0043 Mon Sep 17 00:00:00 2001
From: onefang
Date: Mon, 2 Dec 2019 05:50:58 +1000
Subject: Add more report stuff.
TIMEOUT, report inactive mirrors and why it's not active, add a * for
things tested but not supported.
---
apt-panopticon-report-web.lua | 36 ++++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)
(limited to 'apt-panopticon-report-web.lua')
diff --git a/apt-panopticon-report-web.lua b/apt-panopticon-report-web.lua
index 61102c8..fb41341 100755
--- a/apt-panopticon-report-web.lua
+++ b/apt-panopticon-report-web.lua
@@ -155,24 +155,27 @@ local status = function(host, results, typ)
local e = 0
local w = 0
local s = nil ~= mirrors[host].Protocols[typ]
+ local to = false
if ('http' ~= typ) and ('https' ~= typ) and ('ftp' ~= typ) and ('rsync' ~= typ) then s = true end
if nil ~= results[typ] then
e = results[typ].errors
w = results[typ].warnings
+--[[
for k, v in pairs(results[typ]) do
if "table" == type(v) then
- e = e + v.errors
- w = w + v.warnings
+ if 0 <= v.errors then e = e + v.errors else to = true end
+ if 0 <= v.warnings then w = w + v.warnings else to = true end
end
end
+]]
else
for k, v in pairs(results) do
if "table" == type(v) then
for i, u in pairs(v) do
if "table" == type(u) then
if typ == i then
- e = e + u.errors
- w = w + u.warnings
+ if 0 <= u.errors then e = e + u.errors else to = true end
+ if 0 <= u.warnings then w = w + u.warnings else to = true end
end
end
end
@@ -180,18 +183,24 @@ local status = function(host, results, typ)
end
end
- if 0 < e then
+ if to then
+ if s then
+ result = "[TIMEOUT]"
+ else
+ result = "[TIMEOUT *]"
+ end
+ elseif 0 < e then
if s then
result = "[FAILED]"
else
- result = "[FAILED]"
+ result = "[FAILED *]"
end
faulty = faulty .. host .. " (" .. typ .. ")
\n"
else
if s then
result = "[OK]"
else
- result = "[OK]"
+ result = "[OK *]"
end
end
return result .. plurals(e, w)
@@ -258,7 +267,7 @@ end
local file, e = io.open("results/Report-web.html", "w+")
if nil == file then C("opening mirrors file - " .. e) else
file:write( "
This is the status of the mirror servers in the Devuan package mirror network.
\n" .. "The full list of Devuan package mirrors is available at the URL: " .. @@ -269,21 +278,25 @@ if nil == file then C("opening mirrors file - " .. e) else "
[FAILED] or [OK]" .. " means the tested thing is supported for that mirror.
\n" .. - "[FAILED] or [OK]" .. + "
[FAILED *] or [OK *]" .. " means the tested thing is unsupported for that mirror, but might have been tested anyway.
\n" .. + "[TIMEOUT] or [TIMEOUT]" .. + " means the server had too many timeouts, and tests where aborted, so there is no result for this test.
" .. "The DNS round robin (DNS-RR) column shows the IPs for that mirror, or [no] if it isn't part of the DNS-RR. " .. "The IPs link to the testing log for that IP accessed via the DNS-RR. " .. "deb.devuan.org is the DNS-RR itself, so it doesn't get tested directly.
\n" .. "The time in the Updated column is how often the mirror updates itself.
" .. - "Mirrors with a grey background are not active.
\n" .. + "Mirrors with a grey background are not active (though may be usable as part of the DNS-RR).
\n" .. "[skip] means that the test hasn't been written yet.
\n" .. "