Skip to content

Commit

Permalink
apps.interlink: fix bugs in wait_test.snabb
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Feb 21, 2022
1 parent c0ab1b1 commit cdec562
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/apps/interlink/test_sink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ function start_instrument (name, duration, core)
start(name, duration)
instr.histogram_csv(rebalance_latency, "rebalance")
local min, avg, max = rebalance_latency:summarize()
io.stderr:write(("rebalance latency (ns) min:%16s avg:%16s max:%16s\n")
:format(lib.comma_value(math.floor(min)),
io.stderr:write(("(%d) rebalance latency (ns) min:%16s avg:%16s max:%16s\n")
:format(core,
lib.comma_value(math.floor(min)),
lib.comma_value(math.floor(avg)),
lib.comma_value(math.floor(max))))
io.stderr:flush()
Expand Down
5 changes: 3 additions & 2 deletions src/apps/interlink/test_source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ function startn_instrument (name, duration, n, core)
instr.histogram_csv(reclaim_latency, "reclaim")
local min, avg, max = reclaim_latency:summarize()
engine.main{duration=1, no_report=true}
io.stderr:write(("reclaim latency (ns) min:%16s avg:%16s max:%16s\n")
:format(lib.comma_value(math.floor(min)),
io.stderr:write(("(%d) reclaim latency (ns) min:%16s avg:%16s max:%16s\n")
:format(core,
lib.comma_value(math.floor(min)),
lib.comma_value(math.floor(avg)),
lib.comma_value(math.floor(max))))
io.stderr:write(("%.3f Mpps\n"):format(txpackets / 1e6 / duration))
Expand Down
6 changes: 3 additions & 3 deletions src/apps/interlink/wait_test.snabb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ require("apps.interlink.freelist_instrument").histogram_csv_header()
io.stdout:flush()

for i=1,NCONSUMERS do
worker.start("sink", ([[require("apps.interlink.test_sink").start_instrument(%q, %d, %s)]])
:format("test"..i, DURATION, cores[i]))
worker.start("sink"..i, ([[require("apps.interlink.test_sink").start_instrument(%q, %d, %s)]])
:format("test"..i, DURATION, cores[1+i]))
end

worker.start("source", ([[require("apps.interlink.test_source").startn_instrument(%q, %d, %d, %s)]])
:format("test", DURATION, NCONSUMERS, cores[NCONSUMERS+1]))
:format("test", DURATION, NCONSUMERS, assert(cores[1])))

engine.main{done = function ()
for w, s in pairs(worker.status()) do
Expand Down

0 comments on commit cdec562

Please sign in to comment.