diff options
Diffstat (limited to 'apt-panopticon.lua')
-rwxr-xr-x | apt-panopticon.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 057fc40..ba4d408 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -934,6 +934,14 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. | |||
934 | end | 934 | end |
935 | D('*>* Resumed coroutine NO LONGER waiting on - 0 < APT.checkExes(' .. downloadLock .. list.out .. '-' .. host .. '.log.txt') | 935 | D('*>* Resumed coroutine NO LONGER waiting on - 0 < APT.checkExes(' .. downloadLock .. list.out .. '-' .. host .. '.log.txt') |
936 | 936 | ||
937 | -- Should not be needed, but maybe this is why sometimes I don't see the speeds, though the file is there when I look later. | ||
938 | local f = 'results/curl-' .. list.out .. "-" .. host .. ".log.txt" | ||
939 | while not APT.checkFile(f) do | ||
940 | D('*<* About to yield coroutine while waiting on - not APT.checkFile(' .. f .. ')') | ||
941 | coroutine.yield() | ||
942 | D('*>* Resumed coroutine while waiting on - not APT.checkFile(' .. f .. ')') | ||
943 | end | ||
944 | |||
937 | --[[ TODO - should try to figure out which server the file actually got downloaded from, and attribute the speed and errors to that server. | 945 | --[[ TODO - should try to figure out which server the file actually got downloaded from, and attribute the speed and errors to that server. |
938 | Which means parsing the curl logs, not just a simple match(). | 946 | Which means parsing the curl logs, not just a simple match(). |
939 | Watch out for misplaced ^M, they don't all come at the end of the line. | 947 | Watch out for misplaced ^M, they don't all come at the end of the line. |
@@ -944,8 +952,8 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. | |||
944 | curl: (22) The requested URL returned error: 404 Not Found | 952 | curl: (22) The requested URL returned error: 404 Not Found |
945 | ]] | 953 | ]] |
946 | local min, max, spd = 999999999999, 0 | 954 | local min, max, spd = 999999999999, 0 |
947 | if APT.checkFile("results/curl-" .. list.out .. "-" .. host .. ".log.txt") then | 955 | if APT.checkFile(f) then |
948 | for l in io.lines("results/curl-" .. list.out .. "-" .. host .. ".log.txt") do | 956 | for l in io.lines(f) do |
949 | local speed, crrnt = l:match('^%c *%d+ +%d+k? +%d+ +%d+k? +%d+ +%d+ +(%d+k?) +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +(%d+k?)') | 957 | local speed, crrnt = l:match('^%c *%d+ +%d+k? +%d+ +%d+k? +%d+ +%d+ +(%d+k?) +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +(%d+k?)') |
950 | if nil ~= speed then | 958 | if nil ~= speed then |
951 | if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end | 959 | if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end |