mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Add debug msg
This commit is contained in:
parent
207b3e9221
commit
f1d3b473b4
1 changed files with 9 additions and 1 deletions
|
|
@ -724,7 +724,15 @@ local function delta_val(reg, metric_name, granularity, curr_val, skip_first)
|
|||
local key = string.format("%s:%s", metric_name, granularity_num)
|
||||
|
||||
-- Read cached value and purify it
|
||||
local prev_val = tonumber(reg.getCachedAlertValue(key, granularity_num))
|
||||
local prev_val
|
||||
local prev = reg.getCachedAlertValue(key, granularity_num)
|
||||
if prev == nil or type(prev) ~= "number" then -- Safety check and debug
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Bad prev val")
|
||||
tprint(prev)
|
||||
tprint(debug.traceback())
|
||||
else
|
||||
prev_val = tonumber(prev)
|
||||
end
|
||||
|
||||
-- Save the value for the next round
|
||||
reg.setCachedAlertValue(key, tostring(curr_val), granularity_num)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue