Best Python code snippet using lisa_python
common.py
Source:common.py  
...180    client_sar = client.tools[Sar]181    server_sar = server.tools[Sar]182    server_sar.get_statistics_async()183    result = client_sar.get_statistics()184    pps_message = client_sar.create_pps_performance_messages(185        result, inspect.stack()[1][3], test_type, test_result186    )187    notifier.notify(pps_message)188def perf_ntttcp(189    test_result: TestResult,190    server: Optional[RemoteNode] = None,191    client: Optional[RemoteNode] = None,192    udp_mode: bool = False,193    connections: Optional[List[int]] = None,194    test_case_name: str = "",195    server_nic_name: Optional[str] = None,196    client_nic_name: Optional[str] = None,197) -> List[Union[NetworkTCPPerformanceMessage, NetworkUDPPerformanceMessage]]:198    # Either server and client are set explicitly or we use the first two nodes...sar.py
Source:sar.py  
...67        return process.wait_result(68            expected_exit_code=0,69            expected_exit_code_failure_message="fail to run sar command",70        )71    def create_pps_performance_messages(72        self,73        result: ExecutableResult,74        test_case_name: str,75        test_type: str,76        test_result: "TestResult",77    ) -> NetworkPPSPerformanceMessage:78        # IFACE: Name of the network interface for which statistics are reported.79        # rxpck/s: packet receiving rate (unit: packets/second)80        # txpck/s: packet transmitting rate (unit: packets/second)81        # rxkB/s: data receiving rate (unit: Kbytes/second)82        # txkB/s: data transmitting rate (unit: Kbytes/second)83        # rxcmp/s: compressed packets receiving rate (unit: Kbytes/second)84        # txcmp/s: compressed packets transmitting rate (unit: Kbytes/second)85        # rxmcst/s: multicast packets receiving rate (unit: Kbytes/second)...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
