From 736262928186838d3e50385d03c0262d112492c5 Mon Sep 17 00:00:00 2001 From: lilu Date: Fri, 29 Mar 2024 15:01:51 +0800 Subject: [PATCH] Add get_sar_TCP_task2 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 dad3fb1..f471aa5 100644 --- a/category/get_net_info.py +++ b/category/get_net_info.py @@ -175,6 +175,16 @@ class NetInfo: # print("Sar_TCP task 1 completed") return res_t + def __get_sar_TCP_task2(self, interval, times): + # print("Sar_TCP task 2 started") + # get "sar -n ETCP" command info + sar_command ="sar -n ETCP {} {}".format(interval, times) + cmd_name = 'sar -n TCP' + sar_result_e = Command.cmd_run(sar_command) + res_e = FileOperation.wrap_output_format(cmd_name, sar_result_e, '=') + # print("Sar_TCP task 2 completed") + return res_e + def get_info(self): ''' Get network monitoring information external interface -- Gitee