- for vpci_idx, vpci in enumerate(self._vpci_ascending):
- name = self.vnfd_helper.find_virtual_interface(vpci=vpci)["name"]
- # fixme: VNFDs KPIs values needs to be mapped to TRex structure
- xe_value = last_result.get(vpci_idx, {})
- samples[name] = {
- "rx_throughput_fps": float(xe_value.get("rx_pps", 0.0)),
- "tx_throughput_fps": float(xe_value.get("tx_pps", 0.0)),
- "rx_throughput_mbps": float(xe_value.get("rx_bps", 0.0)),
- "tx_throughput_mbps": float(xe_value.get("tx_bps", 0.0)),
- "in_packets": int(xe_value.get("ipackets", 0)),
- "out_packets": int(xe_value.get("opackets", 0)),
- }
- if key:
- samples[name][key] = key_value
+ # recalculate port for interface and see if it matches ports provided
+ for intf in self.vnfd_helper.interfaces:
+ name = intf["name"]
+ port = self.vnfd_helper.port_num(name)
+ if port in ports:
+ xe_value = last_result.get(port, {})
+ samples[name] = {
+ "rx_throughput_fps": float(xe_value.get("rx_pps", 0.0)),
+ "tx_throughput_fps": float(xe_value.get("tx_pps", 0.0)),
+ "rx_throughput_mbps": float(xe_value.get("rx_bps", 0.0)),
+ "tx_throughput_mbps": float(xe_value.get("tx_bps", 0.0)),
+ "in_packets": int(xe_value.get("ipackets", 0)),
+ "out_packets": int(xe_value.get("opackets", 0)),
+ }
+ if key:
+ samples[name][key] = key_value