Skip to content

Commit

Permalink
Merge PR #541 (app report fixes) into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Jul 3, 2015
2 parents 92007fc + 9febe1b commit 659cb5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
16 changes: 7 additions & 9 deletions src/core/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,13 @@ function report_apps ()
print(name, ("[dead: %s]"):format(app.dead.error))
elseif app.report then
print(name)
with_restart(app, app.report)
end
end
end

function report_each_app ()
for i = 1, #app_array do
if app_array[i].report then
app_array[i]:report()
-- Restarts are currently disabled, still we want to not die on
-- errors during app reports, thus this workaround:
-- with_restart(app, app.report)
local status, err = pcall(app.report)
if not status then
print("Warning: "..name.." threw an error during report: "..err)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/program/packetblaster/packetblaster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function run (args)
app.configure(c)
local fn = function ()
print("Transmissions (last 1 sec):")
app.report_each_app()
app.report_apps()
end
local t = timer.new("report", fn, 1e9, 'repeating')
timer.activate(t)
Expand Down
4 changes: 2 additions & 2 deletions src/program/snabbnfv/traffic/traffic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ local long_opts = {
function run (args)
local opt = {}
local benchpackets
local linkreportinterval = 60
local linkreportinterval = 0
local loadreportinterval = 1
local debugreportinterval = 600
local debugreportinterval = 0
function opt.B (arg) benchpackets = tonumber(arg) end
function opt.h (arg) print(short_usage()) main.exit(1) end
function opt.H (arg) print(long_usage()) main.exit(1) end
Expand Down

0 comments on commit 659cb5c

Please sign in to comment.