- lost_a = stats[port_0][u"opackets"] - stats[port_1][u"ipackets"]
- lost_b = stats[port_1][u"opackets"] - stats[port_0][u"ipackets"]
+ nr_ports = len(client.ports)
+ for i,j in zip(range(nr_ports)[0::2], range(nr_ports)[1::2]):
+ lost_r = stats[i]["opackets"] - stats[j]["ipackets"]
+ lost_l = stats[j]["opackets"] - stats[i]["ipackets"]
+ print(f"packets lost from {i} --> {j}: {lost_r} pkts")
+ print(f"packets lost from {j} --> {i}: {lost_l} pkts")