Skip to content

Commit

Permalink
[designs/neutron/snabbnfv-traffic] Check for new config every second.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Nov 6, 2014
1 parent f50ce95 commit d706c59
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/designs/neutron/snabbnfv-traffic
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@ end
function run (pciaddr, confpath, sockpath)
engine.log = true
local mtime = 0
local report_time = 0
while true do
local mtime2 = C.stat_mtime(confpath)
if mtime2 ~= mtime then
print("Loading " .. confpath)
config.apply(config.load(confpath, pciaddr, sockpath))
mtime = mtime2
end
for i = 1, 60 do
engine.main({duration=1})
-- Flush buffered log messages every 1s
io.flush()
end
engine.main({duration=1})
-- Flush buffered log messages every 1s
io.flush()
-- Report each minute
engine.report()
if (mtime2 - report_time) >= 60 then
engine.report()
report_time = mtime2
end
end
end

Expand Down

0 comments on commit d706c59

Please sign in to comment.