sysSentry/update-log-when-it-is-not-lock-collect.patch
2024-10-09 16:49:36 +08:00

36 lines
1.4 KiB
Diff

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