mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Implement redis num calls charts
This commit is contained in:
parent
d44dad6f31
commit
58d88d161e
10 changed files with 75 additions and 14 deletions
|
|
@ -6,6 +6,7 @@ dirs = ntop.getDirs()
|
|||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
local ts_utils = require("ts_utils")
|
||||
--local json = require("dkjson")
|
||||
|
||||
sendHTTPContentTypeHeader('text/html')
|
||||
|
|
@ -14,7 +15,13 @@ local stats = ntop.getCacheStats()
|
|||
|
||||
for key,val in pairsByValues(stats, rev) do
|
||||
if(key ~= "num_reconnections") then
|
||||
print("<tr><td>"..string.upper(string.sub(key, 5)).."</td><td align=right>"..val.."</td></tr>\n")
|
||||
local chart = ""
|
||||
|
||||
if(ts_utils.exists("redis:hits", {ifid=getSystemInterfaceId(), command=key})) then
|
||||
chart = '<a href="?page=historical&redis_command='..key..'&ts_schema=redis:hits"><i class=\'fa fa-area-chart fa-lg\'></i></a>'
|
||||
end
|
||||
|
||||
print("<tr><td>"..string.upper(string.sub(key, 5)).."</td><td class='text-center'>".. chart .."</td><td align=right>"..val.."</td></tr>\n")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue