!57 update log when it is not lock collect

From: @zhuofeng6 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
This commit is contained in:
openeuler-ci-bot 2024-10-09 09:02:20 +00:00 committed by Gitee
commit 85196fd0f3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -4,7 +4,7 @@
Summary: System Inspection Framework
Name: sysSentry
Version: 1.0.2
Release: 24
Release: 25
License: Mulan PSL v2
Group: System Environment/Daemons
Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz
@ -37,6 +37,7 @@ Patch24: fix-python-3.7-not-support-list-bool-type.patch
Patch25: avg_block_io-send-alarm-to-xalarmd.patch
Patch26: bugfix-typo.patch
Patch27: fix-config-relative-some-issues.patch
Patch28: update-log-when-it-is-not-lock-collect.patch
BuildRequires: cmake gcc-c++
BuildRequires: python3 python3-setuptools
@ -279,6 +280,12 @@ rm -rf %{buildroot}
%attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io
%changelog
* Wed Oct 9 2024 zhuofeng <zhuofeng2@huawei.com> - 1.0.2-25
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:update log when it is not lock collect
* Wed Oct 9 2024 heyouzhi <heyouzhi@huawei.com> - 1.0.2-24
- Type:bugfix
- CVE:NA

View File

@ -0,0 +1,35 @@
From ac73565fdb0e4bc544e5308ea0251dd6be410ed9 Mon Sep 17 00:00:00 2001
From: zhuofeng <zhuofeng2@huawei.com>
Date: Wed, 9 Oct 2024 16:37:24 +0800
Subject: [PATCH] update log when it is not lock collect
---
src/python/sentryCollector/collect_io.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/python/sentryCollector/collect_io.py b/src/python/sentryCollector/collect_io.py
index e45947a..2e75187 100644
--- a/src/python/sentryCollector/collect_io.py
+++ b/src/python/sentryCollector/collect_io.py
@@ -179,13 +179,17 @@ class CollectIo():
blk_io_hierarchy_path = os.path.join(disk_path, 'blk_io_hierarchy')
if not os.path.exists(blk_io_hierarchy_path):
- logging.error("no blk_io_hierarchy directory found in %s, skipping.", disk_name)
+ logging.warning("no blk_io_hierarchy directory found in %s, skipping.", disk_name)
continue
for file_name in os.listdir(blk_io_hierarchy_path):
file_path = os.path.join(blk_io_hierarchy_path, file_name)
if file_name == 'stats':
all_disk.append(disk_name)
+
+ if len(all_disk) == 0:
+ logging.debug("no blk_io_hierarchy disk, it is not lock-free collection")
+ return False
if self.loop_all:
self.disk_list = all_disk
--
2.33.0