diff --git a/sysSentry.spec b/sysSentry.spec index c31718b3846972b6cb8c5e90dea5ed77c95d83af..5837454b286b6dd187d5d7d7b34ea0e58bace8f2 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 69 +Release: 70 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -85,6 +85,7 @@ Patch72: update-nvme-config.patch Patch73: fix-absolute-threshold-not-be-used.patch Patch74: add-debug-log-and-modify-disk-type-for-ebpf.patch Patch75: remove-cpu_sentry.patch +Patch76: uniform-avg_block_io-log-and-ai_block_io-log.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -326,6 +327,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/sentryCollector/__pycache__/collect_plugin* %changelog +* Wed Dec 18 2024 jinsaihang - 1.0.2-70 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:uniform plugins log + * Mon Dec 16 2024 shixuantong - 1.0.2-69 - Type:bugfix - CVE:NA diff --git a/uniform-avg_block_io-log-and-ai_block_io-log.patch b/uniform-avg_block_io-log-and-ai_block_io-log.patch new file mode 100644 index 0000000000000000000000000000000000000000..d9e91f08a7cf047874a5979113655f7bb82551b7 --- /dev/null +++ b/uniform-avg_block_io-log-and-ai_block_io-log.patch @@ -0,0 +1,63 @@ +From c8f21d1621e96e2c8a239f8028cc9331aa0f8997 Mon Sep 17 00:00:00 2001 +From: jinsaihang +Date: Tue, 17 Dec 2024 11:36:11 +0800 +Subject: [PATCH] uniform avg_block_io log and ai_block_io log + +Signed-off-by: jinsaihang +--- + src/python/sentryPlugins/ai_block_io/ai_block_io.py | 5 +++++ + src/python/sentryPlugins/ai_block_io/detector.py | 8 +++----- + src/python/sentryPlugins/avg_block_io/stage_window.py | 2 +- + 3 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/python/sentryPlugins/ai_block_io/ai_block_io.py b/src/python/sentryPlugins/ai_block_io/ai_block_io.py +index 14f740d..8075f5f 100644 +--- a/src/python/sentryPlugins/ai_block_io/ai_block_io.py ++++ b/src/python/sentryPlugins/ai_block_io/ai_block_io.py +@@ -208,6 +208,11 @@ class SlowIODetection: + tmp_alarm_content = alarm_content.copy() + del tmp_alarm_content["details"] + logging.warning("[SLOW IO] " + str(tmp_alarm_content)) ++ logging.warning(f'[SLOW IO] disk: {str(tmp_alarm_content.get("driver_name"))}, ' ++ f'stage: {str(tmp_alarm_content.get("driver_name"))}, ' ++ f'iotype: {str(tmp_alarm_content.get("io_type"))}, ' ++ f'type: {str(tmp_alarm_content.get("alarm_type"))}, ' ++ f'reason: {str(tmp_alarm_content.get("reason"))}') + logging.warning(f"latency: " + str(alarm_content.get("details").get("latency"))) + logging.warning(f"iodump: " + str(alarm_content.get("details").get("iodump"))) + +diff --git a/src/python/sentryPlugins/ai_block_io/detector.py b/src/python/sentryPlugins/ai_block_io/detector.py +index 496e032..27fb7f7 100644 +--- a/src/python/sentryPlugins/ai_block_io/detector.py ++++ b/src/python/sentryPlugins/ai_block_io/detector.py +@@ -58,11 +58,9 @@ class Detector: + logging.info(f'[abnormal_period]: disk: {self._metric_name.disk_name}, ' + f'stage: {self._metric_name.stage_name}, ' + f'iotype: {self._metric_name.io_access_type_name}, ' +- f'metric: {self._metric_name.metric_name}, ' +- f'current value: {metric_value}, ' +- f'ai threshold: {detection_result[2]}, ' +- f'absolute threshold upper limit: {detection_result[3]}, ' +- f'lower limit: {detection_result[4]}') ++ f'type: {self._metric_name.metric_name}, ' ++ f'ai_threshold: {round(detection_result[2], 3)}, ' ++ f'curr_val: {metric_value}') + else: + logging.debug(f'Detection result: {str(detection_result)}') + logging.debug(f'exit Detector: {self}') +diff --git a/src/python/sentryPlugins/avg_block_io/stage_window.py b/src/python/sentryPlugins/avg_block_io/stage_window.py +index 5113782..587bd49 100644 +--- a/src/python/sentryPlugins/avg_block_io/stage_window.py ++++ b/src/python/sentryPlugins/avg_block_io/stage_window.py +@@ -28,7 +28,7 @@ class AbnormalWindowBase: + self.abnormal_window.append(False) + + def is_abnormal_window(self): +- return sum(self.abnormal_window) > self.window_threshold ++ return sum(self.abnormal_window) >= self.window_threshold + + def window_data_to_string(self): + return ",".join(str(x) for x in self.window_data) +-- +2.27.0 +