mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Add query stats to alert queries
This commit is contained in:
parent
750bb8c2c0
commit
f81a45721b
10 changed files with 91 additions and 35 deletions
|
|
@ -40,10 +40,10 @@ interface.select(ifid)
|
|||
-- Fetch the results
|
||||
local alerts, recordsFiltered
|
||||
if ntop.isClickHouseEnabled() then
|
||||
alerts, recordsFiltered = flow_alert_store:select_request(nil, "*")
|
||||
alerts, recordsFiltered, info = flow_alert_store:select_request(nil, "*")
|
||||
else
|
||||
-- SQLite need conversion to HEX
|
||||
alerts, recordsFiltered = flow_alert_store:select_request(nil, "*, hex(alerts_map) alerts_map")
|
||||
alerts, recordsFiltered, info = flow_alert_store:select_request(nil, "*, hex(alerts_map) alerts_map")
|
||||
end
|
||||
|
||||
for _, _value in ipairs(alerts or {}) do
|
||||
|
|
@ -54,7 +54,12 @@ if no_html then
|
|||
res = flow_alert_store:to_csv(res)
|
||||
rest_utils.vanilla_payload_response(rc, res, "text/csv")
|
||||
else
|
||||
rest_utils.extended_answer(rc, {records = res}, {
|
||||
local data = {
|
||||
records = res,
|
||||
stats = info,
|
||||
}
|
||||
|
||||
rest_utils.extended_answer(rc, data, {
|
||||
["draw"] = tonumber(_GET["draw"]),
|
||||
["recordsFiltered"] = recordsFiltered,
|
||||
["recordsTotal"] = #res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue