mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Added script tracings
This commit is contained in:
parent
9ccf4e5acc
commit
74f03c3a38
17 changed files with 91 additions and 4 deletions
|
|
@ -15,13 +15,16 @@ network_utils.UNKNOWN_NETWORK = 65535 -- uint16 (-1)
|
|||
local function getThroughputType()
|
||||
local throughput_type = ntop.getCache("ntopng.prefs.thpt_content")
|
||||
if throughput_type == "" then throughput_type = "bps" end
|
||||
|
||||
return throughput_type
|
||||
end
|
||||
|
||||
network_utils.throughput_type = getThroughputType()
|
||||
-- network_utils.throughput_type = getThroughputType()
|
||||
|
||||
function network_utils.network2record(ifId, network)
|
||||
local record = {}
|
||||
local throughput_type = getThroughputType()
|
||||
|
||||
record["key"] = tostring(network["network_id"])
|
||||
|
||||
local network_link = "<A HREF='"..ntop.getHttpPrefix()..'/lua/hosts_stats.lua?network='..network["network_id"].."' title='"..network["network_key"].."'>"..getFullLocalNetworkName(network["network_key"])..'</A>'
|
||||
|
|
@ -36,7 +39,7 @@ function network_utils.network2record(ifId, network)
|
|||
record["column_breakdown"] = "<div class='progress'><div class='progress-bar bg-warning' style='width: "
|
||||
.. sent2rcvd .."%;'>Sent</div><div class='progress-bar bg-success' style='width: " .. (100-sent2rcvd) .. "%;'>Rcvd</div></div>"
|
||||
|
||||
if(network_utils.throughput_type == "pps") then
|
||||
if(throughput_type == "pps") then
|
||||
record["column_thpt"] = pktsToSize(network["throughput_pps"])
|
||||
else
|
||||
record["column_thpt"] = bitsToSize(8*network["throughput_bps"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue