From 1dfaf2af8f1fdee901b27f0ddf27fd036b44bba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=92=90?= Date: Fri, 22 Mar 2024 16:33:25 +0800 Subject: [PATCH] Add sar_n_TCP function to get_net_info.py --- category/get_net_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/category/get_net_info.py b/category/get_net_info.py index 73aef54..aed1ba2 100644 --- a/category/get_net_info.py +++ b/category/get_net_info.py @@ -159,6 +159,16 @@ class NetInfo: res = self.__multi_threads_get_info(tasks, interval, times) return Command.cmd_write_file(res, self.__default_file_name) + def __get_sar_TCP_task1(self, interval, times): + # print("Sar_TCP task 1 started") + # get "sar -n TCP" command info + sar_command ="sar -n TCP {} {}".format(interval, times) + cmd_name = 'sar -n TCP' + sar_result = Command.cmd_run(sar_command) + res_t = FileOperation.wrap_output_format(cmd_name, sar_result, '-') + # print("Sar_TCP task 1 completed") + return res_t + def get_info(self): ''' Get network monitoring information external interface -- Gitee