Skip to content
Snippets Groups Projects
Commit 9e8c60da authored by Tomas Krizek's avatar Tomas Krizek
Browse files

Merge branch 'shotgun' into 'master'

shotgun: use updated statistics collection

See merge request !3
parents 1a034943 79b6f654
Branches
Tags
1 merge request!3shotgun: use updated statistics collection
Pipeline #53594 passed with stage
in 19 seconds
......@@ -10,9 +10,8 @@ local getopt = require("dnsjit.lib.getopt").new({
{ "b", "bind", "", "Source IPv6 bind address pattern (example: 'fd00::%x')", "?" },
{ "i", "ips", 1, "Number of source IPs per thread (when -b is set)", "?" },
{ "d", "drift", 1.0, "Maximum realtime drift (seconds)", "?" },
{ "S", "stats_interval", 100000,
"Interval for logging statistics (in packets per thread)", "?" },
{ "O", "outdir", ".", "directory for output files (must exist)", "?" },
{ "S", "stats_interval", 5, "Log statistics every N seconds", "?" },
{ "O", "outdir", ".", "Directory for output files (must exist)", "?" },
})
local pcap = unpack(getopt:parse())
if getopt:val("help") then
......@@ -60,7 +59,7 @@ local function thread_output(thr)
output:udp_only()
output:target(thr:pop(), thr:pop())
output:timeout(thr:pop())
output:log_interval(thr:pop())
output:stats_collect(thr:pop())
output:free_after_use(true)
local outfile = thr:pop()
......@@ -89,6 +88,7 @@ local function thread_output(thr)
-- check if channel is still open
if obj == nil and channel.closed == 1 then
output:stats_finish()
break
end
end
......@@ -167,11 +167,3 @@ end
for i = 1, SEND_THREADS do
threads[i]:stop()
end
--print outfiles
for i = 1, SEND_THREADS do
local f = assert(io.open(string.format(outname, i), "r"))
local content = f:read("*all")
f:close()
print(content)
end
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment