diff --git a/src/sentryCollector/collect_io.py b/src/sentryCollector/collect_io.py index a7e86cbfa92b27422adb96794271ec09ded42dec..718ee94dd694e666e11eb71946a9505ac211627c 100644 --- a/src/sentryCollector/collect_io.py +++ b/src/sentryCollector/collect_io.py @@ -19,7 +19,7 @@ import threading import subprocess from typing import Union -from .collect_config import CollectConfig +from .collect_config import CollectConfig, get_log_level Io_Category = ["read", "write", "flush", "discard"] IO_GLOBAL_DATA = {} @@ -58,6 +58,8 @@ class CollectIo(): self.stop_event = threading.Event() + self.log_level = logging.getLevelName(get_log_level()).lower() + IO_CONFIG_DATA.append(self.period_time) IO_CONFIG_DATA.append(self.max_save) @@ -266,6 +268,8 @@ class CollectIo(): if EBPF_GLOBAL_DATA: for data in EBPF_GLOBAL_DATA: data_list = data.split() + if data_list[0] not in EBPF_STAGE_LIST: + getattr(logging, self.log_level)("[ebpf] " + data) if len(data_list) != 6: continue stage, finish_count, latency, io_dump, io_type ,disk_name = data_list @@ -413,7 +417,7 @@ class CollectIo(): def main_loop(self): global IO_GLOBAL_DATA logging.info("collect io thread start") - + if self.is_kernel_avaliable() and len(self.disk_map_stage) != 0: for disk_name, stage_list in self.disk_map_stage.items(): for stage in stage_list: