Fixes wrongly formatter used for behavior anomaly alert

This commit is contained in:
MatteoBiscosi 2021-06-28 11:38:20 +02:00
parent 221629ff74
commit c3a85560a7
8 changed files with 37 additions and 23 deletions

View file

@ -787,9 +787,15 @@ function alert_utils.formatBehaviorAlert(params, anomalies, stats, id, subtype,
local value = stats[anomaly_type]["value"]
if anomaly_table["formatter"] then
value = anomaly_table["formatter"](value)
lower_bound = anomaly_table["formatter"](lower_bound)
upper_bound = anomaly_table["formatter"](upper_bound)
value = anomaly_table["formatter"](value * (anomaly_table["multiplier"] or 1))
lower_bound = anomaly_table["formatter"](lower_bound * (anomaly_table["multiplier"] or 1))
upper_bound = anomaly_table["formatter"](upper_bound * (anomaly_table["multiplier"] or 1))
end
if anomaly_table["cut_values"] then
value = string.format("%.2f", value)
lower_bound = string.format("%.2f", lower_bound)
upper_bound = string.format("%.2f", upper_bound)
end
local alert = alert_consts.alert_types.alert_behavior_anomaly.new(