diff --git a/failslow/failslow/fail_slow_detection.py b/failslow/failslow/fail_slow_detection.py index 38f9b9de6c5903f136815a3ff5c57e877f38c808..c8bf7fdc903e7a23d4f924df95bab798c9bcff45 100644 --- a/failslow/failslow/fail_slow_detection.py +++ b/failslow/failslow/fail_slow_detection.py @@ -68,10 +68,12 @@ def detect_step_time_anomalies(data_df: pd.DataFrame, model_args: Dict): anomaly_info["is_anomaly"] = True anomaly_info["anomaly_count_times"] = len(anomalies) anomaly_info["anomaly_info"] = anomalies + anomaly_info["anomaly_type"] = AnomalyType.fail_slow else: anomaly_info["is_anomaly"] = False anomaly_info["anomaly_count_times"] = 0 anomaly_info["anomaly_info"] = [] + anomaly_info["anomaly_type"] = AnomalyType.normal anomaly_info["start_time"] = int(timestamps.iloc[0]) anomaly_info["end_time"] = int(timestamps.iloc[len(timestamps) - 1]) return anomaly_info @@ -187,9 +189,8 @@ def run_slow_node_perception(args: Dict): detecting_range_steps[0] = task_stable_step logger.info(f"Detection data: {detecting_range_steps}.") data = data.loc[detecting_range_steps[0]: detecting_range_steps[1]].reset_index(drop=True) - anomaly_info = detect_step_time_anomalies(data, model_args) + anomaly_info = detect_step_time_anomalies(data, args) - anomaly_info["anomaly_type"] = AnomalyType.fail_slow write_anomaly_info(anomaly_info, fail_slow_perception_result) fail_slow_stop_flag = os.getenv('FAIL_SLOW_STOP', 'False').lower() == "true" diff --git a/failslow/failslow/util/constant.py b/failslow/failslow/util/constant.py index 3ceb4ea945862b7c5464aec64c54b93e41cc19fc..a1ca94229a069243928b85a921e0b39beffd8518 100644 --- a/failslow/failslow/util/constant.py +++ b/failslow/failslow/util/constant.py @@ -19,6 +19,7 @@ HOUR_TO_SECONDS = 3600 MS_TO_NS = 1e6 class AnomalyType: + normal = "normal" fail_slow = "failSlow" hang = "hang" diff --git a/failslow/setup.py b/failslow/setup.py index 6ae1e0b651240660572b4f1c1d6e1515171fe519..618f37722267314a85cae082f63158dad5be2127 100644 --- a/failslow/setup.py +++ b/failslow/setup.py @@ -46,6 +46,7 @@ setup( "matplotlib", "joblib", "scikit_learn", + "protobuf==3.20.3" ], entry_points={ "console_scripts": [