From 6a6c7a1d0345a64ae833b1239b2550bab3c64c79 Mon Sep 17 00:00:00 2001 From: lixiaoyong1 Date: Tue, 27 Feb 2024 17:25:08 +0800 Subject: [PATCH] Add function __get_mem_info to class MemInfo --- category/get_memory_info.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/category/get_memory_info.py b/category/get_memory_info.py index 3e39bb2..5d49e09 100644 --- a/category/get_memory_info.py +++ b/category/get_memory_info.py @@ -19,3 +19,14 @@ class MemInfo(): self.__interval = GlobalParameter().get_mem_interval() # 默认执行5次 self.__times = GlobalParameter().get_mem_times() + + def __get_mem_info(self): + ''' + Mem information + ''' + mem_command="cat /proc/meminfo" + cmd_name_m = mem_command + cmd_result = Command.cmd_run(mem_command) + res_m = FileOperation.wrap_output_format(cmd_name_m, cmd_result, '-') + return Command.cmd_write_file(res_m, self.__default_file_name) + -- Gitee