From fb617ad2e22c3c7ad705cb6748da57b5417985b2 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 3 Dec 2019 06:27:15 +1000 Subject: Test and report speed. --- apt-panopticon.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'apt-panopticon.lua') diff --git a/apt-panopticon.lua b/apt-panopticon.lua index d2fa9b9..8566dad 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -745,9 +745,9 @@ local downloadLock = "flock -n results/curl-" local download = "curl --connect-timeout " .. options.timeout.value .. " --create-dirs -f -L --max-time " .. options.maxtime.value .. " -z 'results/stamp.old' -v -R " local downloads = function(host, URL, release, list) if nil == URL then URL = "" end - local lock = "%s-" .. host .. ".lock" - local log = " --stderr results/curl-%s_" .. host .. ".log" - local cm = "ionice -c3 nice -n 19 " .. downloadLock .. lock:format("META") .. " " .. download .. log:format("META") .. " -K results/" .. host .. ".curl" + local lock = "META-" .. host .. ".lock" + local log = " --stderr results/curl-META-" .. host .. ".log" + local cm = "ionice -c3 nice -n 19 " .. downloadLock .. lock .. " " .. download .. log .. " -K results/" .. host .. ".curl" if testing("IPv4") and (not testing("IPv6")) then cm = cm .. ' -4' end if (not testing("IPv4")) and testing("IPv6") then cm = cm .. ' -6' end f, e = io.open("results/" .. host .. ".curl", "a+") @@ -968,7 +968,8 @@ if 0 < #arg then if 4 > (totalTimeouts) then if origin and (options.roundRobin.value ~= pu.host) then while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end - os.execute("rm -f results/" .. pu.host .. ".curl; rm results/curl-" .. "META-" .. pu.host .. ".lock") + os.execute( "rm -f results/" .. pu.host .. ".curl; rm results/curl-META-" .. pu.host .. ".lock; " .. + "mv results/curl-META-" .. pu.host .. ".log results/curl-Release-" .. pu.host .. ".log") for i, n in pairs(releases) do for l, o in pairs(releaseFiles) do if repoExists(i .. o) then @@ -998,7 +999,8 @@ if 0 < #arg then downloads(pu.host, pu.path, "", "") while 0 < checkExes(downloadLock .. "META-" .. pu.host .. ".lock") do os.execute("sleep 10") end - os.execute("rm -f results/" .. pu.host .. ".curl; rm results/curl-" .. "META-" .. pu.host .. ".lock") + os.execute( "rm -f results/" .. pu.host .. ".curl; rm results/curl-META-" .. pu.host .. ".lock; " .. + "mv results/curl-META-" .. pu.host .. ".log results/curl-Packages-" .. pu.host .. ".log") for i, n in pairs(releases) do local dfile, e = io.open('results/NEW_Release_' .. n .. '.txt', "r") -- cgit v1.1