mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 17:30:11 +00:00
Add per thread stats in the Ntop class. Add timeseries with cpu load per thread with 5s granularity.
This commit is contained in:
parent
5c224bec94
commit
a19db8e13a
19 changed files with 171 additions and 21 deletions
|
|
@ -33,12 +33,30 @@ function ts_dump.dump_cpu_stats(ifid, when)
|
|||
}, when)
|
||||
end
|
||||
|
||||
if cpu_load then
|
||||
ts_utils.append("system:cpu_load", {
|
||||
ifid = ifid,
|
||||
load_percentage = cpu_load
|
||||
}, when)
|
||||
end
|
||||
if cpu_load then
|
||||
ts_utils.append("system:cpu_load", {
|
||||
ifid = ifid,
|
||||
load_percentage = cpu_load
|
||||
}, when)
|
||||
end
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
function ts_dump.dump_thread_cpu_stats(ifid, when)
|
||||
local threads_info = ntop.threadsInfo()
|
||||
if not threads_info then return end
|
||||
|
||||
for thread_name, stats in pairs(threads_info) do
|
||||
local cpu_pct = stats["cpu_utilization_pct"]
|
||||
if cpu_pct ~= nil then
|
||||
ts_utils.append("system:thread_cpu_load", {
|
||||
ifid = ifid,
|
||||
thread_name = thread_name,
|
||||
cpu_utilization_pct = cpu_pct
|
||||
}, when)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue