From f61c2148aec5d19c600e2042f7320f746fecd347 Mon Sep 17 00:00:00 2001 From: lixiaoyong1 Date: Thu, 29 Feb 2024 18:15:13 +0800 Subject: [PATCH] Add vmstat interval and times parameter --- category/get_memory_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/category/get_memory_info.py b/category/get_memory_info.py index 1d2abde..77c161b 100644 --- a/category/get_memory_info.py +++ b/category/get_memory_info.py @@ -52,7 +52,11 @@ class MemInfo(): cmd_result = Command.cmd_run(vmstat_s_cmd) res_vmstat_s = FileOperation.wrap_output_format(cmd_name, cmd_result,'-') - res = res_free + res_vmstat_s + vmstat_command="vmstat {} {}".format(interval, times) + cmd_result = Command.cmd_run(vmstat_command) + res_vmstat = FileOperation.wrap_output_format(cmd_name, cmd_result,'=') + + res = res_free + res_vmstat_s + res_vmstat return Command.cmd_write_file(res, self.__default_file_name) def get_info(self): -- Gitee