|
|
@ -363,7 +363,7 @@ if nil == web then C("opening mirrors file - " .. e) else |
|
|
|
"<table>\n<tr><th></th><th>" .. lnk('FTP') .. "</th><th>" .. lnk('HTTP') .. "</th><th>" .. lnk('HTTPS') .. "</th><th>" .. lnk('RSYNC') .. "</th>" .. |
|
|
|
"<th>" .. lnk('DNS round robin', 'DNS-RR') .. "</th><th>" .. lnk('Protocol') .. "</th><th>" .. lnk('URL sanity', 'URL-Sanity') .. "</th><th>" .. lnk('Integrity') .. "</th>" .. |
|
|
|
"<th>" .. lnk('Updated') .. "</th><th colspan='2'>" .. lnk('Speed range', 'Speed') .. "</th>" .. |
|
|
|
"<th colspan='2'>" .. lnk('Weekly averages', 'Weekly') .. "</th><th>" .. lnk('Graphs') .. "</th></tr>\n" |
|
|
|
"<th colspan='2'>" .. lnk('Weekly statistics', 'Weekly') .. "</th><th>" .. lnk('Graphs') .. "</th></tr>\n" |
|
|
|
) |
|
|
|
|
|
|
|
local bg = '' |
|
|
@ -391,7 +391,7 @@ if nil == web then C("opening mirrors file - " .. e) else |
|
|
|
local min = tonumber(results.speed.min) |
|
|
|
local max = tonumber(results.speed.max) |
|
|
|
local spd = '<td></td><td></td>' |
|
|
|
local week = '<td>xxx% up</td><td>xxx% updated</td>' |
|
|
|
local week = '<td></td><td></td>' |
|
|
|
local graph = '<a href="../apt-panopticon_cgp/host.php?h=' .. k .. '">graphs</a>' |
|
|
|
|
|
|
|
-- DNS-RR test. |
|
|
@ -432,6 +432,48 @@ if nil == web then C("opening mirrors file - " .. e) else |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
if ("deb.devuan.org" ~= k) then |
|
|
|
local percentUp = '???' |
|
|
|
local percentUpdated = '???' |
|
|
|
if APT.checkFile('rrd/' .. k .. '/Speed/Speed.rrd') then |
|
|
|
local start, step, names, data = APT.rrd.fetch('rrd/' .. k .. '/Speed/Speed.rrd', 'LAST', '-a', '-r', '10m', '-s', '-1w') |
|
|
|
local count, up, down, unknown = 0, 0, 0, 0 |
|
|
|
for i,dp in ipairs(data) do |
|
|
|
for j,v in ipairs(dp) do |
|
|
|
if 'max' == names[j] then |
|
|
|
if 'nan' == tostring(v) then |
|
|
|
unknown = unknown + 1 |
|
|
|
else |
|
|
|
count = count + 1 |
|
|
|
if 0 == v then down = down + 1 else up = up + 1 end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
percentUp = string.format('%d', up / count * 100) |
|
|
|
end |
|
|
|
if APT.checkFile('rrd/' .. k .. '/HTTP/Tests.rrd') then |
|
|
|
local start, step, names, data = APT.rrd.fetch('rrd/' .. k .. '/HTTP/Tests.rrd', 'LAST', '-a', '-r', '10m', '-s', '-1w') |
|
|
|
local count, up, down, unknown = 0, 0, 0, 0 |
|
|
|
for i,dp in ipairs(data) do |
|
|
|
for j,v in ipairs(dp) do |
|
|
|
if 'UpdatedErrors' == names[j] then |
|
|
|
if 'nan' == tostring(v) then |
|
|
|
unknown = unknown + 1 |
|
|
|
else |
|
|
|
count = count + 1 |
|
|
|
if 0 == v then down = down + 1 else up = up + 1 end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
percentUpdated = string.format('%d', (down / count * 100)) |
|
|
|
if '0' == percentUp then percentUpdated = '??' end -- We are counting errors, and you can't get an error if you can't check anything. |
|
|
|
-- TODO - try to account for this better, this is just a quick hack. |
|
|
|
end |
|
|
|
week = '<td>' .. percentUp .. '% up</td><td>' .. percentUpdated .. '% updated</td>' |
|
|
|
end |
|
|
|
|
|
|
|
web:write("<td>" .. ftp .. " </td><td>" .. http .. " </td><td>" .. https .. " </td><td>" .. rsync .. " </td><td>" .. dns .. |
|
|
|
" </td><td>" .. protocol .. " </td><td>" .. sanity .. " </td><td>" .. integrity .. " </td><td>" .. updated .. |
|
|
|
" " .. spd .. " " .. week .." <td>" .. graph .. "</td></tr>\n") |
|
|
@ -491,7 +533,7 @@ if nil == web then C("opening mirrors file - " .. e) else |
|
|
|
"<table>\n<tr><th></th><th>" .. lnk('FTP') .. "</a></th><th>" .. lnk('HTTP') .. "</th><th>" .. lnk('HTTPS') .. "</th><th>" .. lnk('RSYNC') .. "</th>" .. |
|
|
|
"<th>" .. lnk('DNS round robin', 'DNS-RR') .. "</th><th>" .. lnk('Protocol') .. "</th><th>" .. lnk('URL sanity', 'URL-Sanity') .. "</th><th>" .. lnk('Integrity') .. "</th>" .. |
|
|
|
"<th>" .. lnk('Updated') .. "</th><th colspan='2'>" .. lnk('Speed range', 'Speed') .. "</th>" .. |
|
|
|
"<th colspan='2'>" .. lnk('Weekly averages', 'Weekly') .. "</th><th>" .. lnk('Graphs') .. "</th></tr>\n" |
|
|
|
"<th colspan='2'>" .. lnk('Weekly statistics', 'Weekly') .. "</th><th>" .. lnk('Graphs') .. "</th></tr>\n" |
|
|
|
) |
|
|
|
for k, v in APT.orderedPairs(APT.debians) do |
|
|
|
if '' == bg then bg = " style='background-color:#111111'" else bg = '' end |
|
|
|