mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-10 00:42:14 +00:00
Improve and fix DNS replies/requests ratio
This commit is contained in:
parent
5a67b70bdd
commit
5dd88985f4
3 changed files with 17 additions and 9 deletions
|
|
@ -649,12 +649,16 @@ end
|
|||
function requestReplyRatioFormatter(ifid, alert, info)
|
||||
local entity = firstToUpper(formatAlertEntity(ifid, alertEntityRaw(alert["alert_entity"]), alert["alert_entity_val"]))
|
||||
local engine_label = alertEngineLabel(alertEngine(sec2granularity(alert["alert_granularity"])))
|
||||
local ratio = math.min((info.replies * 100) / (info.requests + 1), 100)
|
||||
local ratio = round(math.min((info.replies * 100) / (info.requests + 1), 100), 1)
|
||||
|
||||
return(i18n("alerts_dashboard.request_replies_alert_descr", {
|
||||
local subtype_to_label = {
|
||||
dns_sent = "alerts_dashboard.too_low_dns_replies_received",
|
||||
dns_rcvd = "alerts_dashboard.too_low_dns_replies_sent",
|
||||
}
|
||||
|
||||
return(i18n(subtype_to_label[alert.alert_subtype], {
|
||||
entity = entity,
|
||||
granularity = engine_label,
|
||||
what = alert.alert_subtype,
|
||||
ratio = ratio,
|
||||
requests = info.requests,
|
||||
replies = info.replies,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue