Added script tracings

This commit is contained in:
Luca 2022-08-30 18:38:05 +02:00
parent 9ccf4e5acc
commit 74f03c3a38
17 changed files with 91 additions and 4 deletions

View file

@ -3,6 +3,8 @@
--
--
local clock_start = os.clock()
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
@ -148,4 +150,8 @@ function rest_utils.vanilla_payload_response(ret_const, payload, content_type, e
print(payload)
end
if(trace_script_duration ~= nil) then
io.write(debug.getinfo(1,'S').source .." executed in ".. (os.clock()-clock_start)*1000 .. " ms\n")
end
return rest_utils