mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Make interface realtime refresh rate configurable
This commit is contained in:
parent
c6d62bf2ac
commit
ca1d85c94e
6 changed files with 84 additions and 111 deletions
|
|
@ -1913,6 +1913,40 @@ function getInterfaceNameAlias(interface_name)
|
|||
end
|
||||
end
|
||||
|
||||
function getInterfaceSpeed(ifstats)
|
||||
local ifspeed = ntop.getCache('ntopng.prefs.'..ifstats.name..'.speed')
|
||||
if not isEmptyString(ifspeed) and tonumber(ifspeed) ~= nil then
|
||||
ifspeed = tonumber(ifspeed)
|
||||
else
|
||||
ifspeed = ifstats.speed
|
||||
end
|
||||
|
||||
return ifspeed
|
||||
end
|
||||
|
||||
function getInterfaceRefreshRate(ifid)
|
||||
local key = getRedisIfacePrefix(ifid)..".refresh_rate"
|
||||
local refreshrate = ntop.getCache(key)
|
||||
|
||||
if isEmptyString(refreshrate) or tonumber(refreshrate) == nil then
|
||||
refreshrate = 3
|
||||
else
|
||||
refreshrate = tonumber(refreshrate)
|
||||
end
|
||||
|
||||
return refreshrate
|
||||
end
|
||||
|
||||
function setInterfaceRegreshRate(ifid, refreshrate)
|
||||
local key = getRedisIfacePrefix(ifid)..".refresh_rate"
|
||||
|
||||
if isEmptyString(refreshrate) then
|
||||
ntop.delCache(key)
|
||||
else
|
||||
ntop.setCache(key, tostring(refreshrate))
|
||||
end
|
||||
end
|
||||
|
||||
function getHumanReadableInterfaceName(interface_name)
|
||||
key = 'ntopng.prefs.'..interface_name..'.name'
|
||||
custom_name = ntop.getCache(key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue