mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 02:16:39 +00:00
Avoid returning topk items with zero bytes
This commit is contained in:
parent
b8aa23f46d
commit
b604288c9b
1 changed files with 6 additions and 4 deletions
|
|
@ -564,10 +564,12 @@ function driver:topk(schema, tags, tstart, tend, options, top_tags)
|
|||
local topk = {}
|
||||
|
||||
for top_item, value in pairsByValues(items, rev) do
|
||||
topk[#topk + 1] = {
|
||||
tags = tag_2_series[top_item],
|
||||
value = value,
|
||||
}
|
||||
if value > 0 then
|
||||
topk[#topk + 1] = {
|
||||
tags = tag_2_series[top_item],
|
||||
value = value,
|
||||
}
|
||||
end
|
||||
|
||||
if #topk >= options.top then
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue