From 0d2a262b2c6b59813693921a25b4884f6e98ae61 Mon Sep 17 00:00:00 2001 From: Amatullah Date: Thu, 11 Aug 2022 14:04:16 +0400 Subject: [PATCH] fix(anomaly): convert slack into hourly value for hourly KPIs --- chaos_genius/core/anomaly/controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chaos_genius/core/anomaly/controller.py b/chaos_genius/core/anomaly/controller.py index 717e6ece6..0f52c824e 100644 --- a/chaos_genius/core/anomaly/controller.py +++ b/chaos_genius/core/anomaly/controller.py @@ -76,7 +76,11 @@ def __init__( self.debug = True if self.debug == "False": self.debug = False - self.slack = MAX_ANOMALY_SLACK_DAYS + self.slack = ( + MAX_ANOMALY_SLACK_DAYS * 24 + if self.kpi_info["anomaly_params"]["frequency"] == "H" + else MAX_ANOMALY_SLACK_DAYS + ) if self.kpi_info["anomaly_params"]["frequency"] == "H": period = int(self.kpi_info["anomaly_params"]["anomaly_period"]) * 24