mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-10 00:42:14 +00:00
Cache if_stats_ndpi timeseries query results
This commit is contained in:
parent
511e0a5d00
commit
92270410ed
1 changed files with 11 additions and 1 deletions
|
|
@ -77,7 +77,17 @@ for _k in pairsByKeys(vals, asc) do
|
|||
end
|
||||
end
|
||||
|
||||
if(ts_utils.exists("iface:ndpi", {ifid=ifid, protocol=k})) then
|
||||
local proto_cache_key = "ntopng.cache.has_ndpi_" .. ifid.."_".. k
|
||||
local has_ndpi_proto = ntop.getCache(proto_cache_key)
|
||||
|
||||
if has_ndpi_proto ~= "1" then
|
||||
if ts_utils.exists("iface:ndpi", {ifid=ifid, protocol=k}) then
|
||||
has_ndpi_proto = "1"
|
||||
ntop.setCache(proto_cache_key, "1", 300)
|
||||
end
|
||||
end
|
||||
|
||||
if(has_ndpi_proto == "1") then
|
||||
if(not(json_format)) then
|
||||
print("<A HREF=\""..ntop.getHttpPrefix().."/lua/if_stats.lua?ifid=" .. ifid .. "&page=historical&ts_schema=iface:ndpi&protocol=".. k .."\">".. k .." "..formatBreed(ifstats["ndpi"][k]["breed"]).."</A>")
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue