diff options
author | Serhiy Pshyk <serhiyx.pshyk@intel.com> | 2019-02-18 13:23:40 +0000 |
---|---|---|
committer | Serhiy Pshyk <serhiyx.pshyk@intel.com> | 2019-02-19 13:13:29 +0000 |
commit | da9f1c865045ffc418646d33bc3d95376e5ef019 (patch) | |
tree | e7abef0dddc32d1371ed736e04e805f2da751d88 /yardstick/network_services/vnf_generic/vnf | |
parent | d05cb96c045a9a65d7db424300677f36f3d4f7b4 (diff) |
Unify IXIA/Trex test cases results
List of changes:
- Unified naming of all counters reported by IXIA/Trex
- Removed not valid counters reported by IXIA
- Added per interface stats reported by Trex
- Fixed latency calculation for Trex tg
JIRA: YARDSTICK-1592
Change-Id: Ia3d450058f884579f4d331772a8cf6de22146ac3
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Diffstat (limited to 'yardstick/network_services/vnf_generic/vnf')
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py | 70 |
1 files changed, 31 insertions, 39 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py index 5d64a8cba..80812876d 100644 --- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py +++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py @@ -80,21 +80,17 @@ class IxiaBasicScenario(object): min_latency = stats['Store-Forward_Min_latency_ns'][port_num] max_latency = stats['Store-Forward_Max_latency_ns'][port_num] samples[port_name] = { - 'rx_throughput_kps': float(stats['Rx_Rate_Kbps'][port_num]), - 'tx_throughput_kps': float(stats['Tx_Rate_Kbps'][port_num]), - 'rx_throughput_mbps': float(stats['Rx_Rate_Mbps'][port_num]), - 'tx_throughput_mbps': float(stats['Tx_Rate_Mbps'][port_num]), 'RxThroughputBps': float(stats['Bytes_Rx'][port_num]) / duration, 'TxThroughputBps': float(stats['Bytes_Tx'][port_num]) / duration, - 'in_packets': int(stats['Valid_Frames_Rx'][port_num]), - 'out_packets': int(stats['Frames_Tx'][port_num]), - 'in_bytes': int(stats['Bytes_Rx'][port_num]), - 'out_bytes': int(stats['Bytes_Tx'][port_num]), + 'InPackets': int(stats['Valid_Frames_Rx'][port_num]), + 'OutPackets': int(stats['Frames_Tx'][port_num]), + 'InBytes': int(stats['Bytes_Rx'][port_num]), + 'OutBytes': int(stats['Bytes_Tx'][port_num]), 'RxThroughput': float(stats['Valid_Frames_Rx'][port_num]) / duration, 'TxThroughput': float(stats['Frames_Tx'][port_num]) / duration, - 'Store-Forward_Avg_latency_ns': utils.safe_cast(avg_latency, int, 0), - 'Store-Forward_Min_latency_ns': utils.safe_cast(min_latency, int, 0), - 'Store-Forward_Max_latency_ns': utils.safe_cast(max_latency, int, 0) + 'LatencyAvg': utils.safe_cast(avg_latency, int, 0), + 'LatencyMin': utils.safe_cast(min_latency, int, 0), + 'LatencyMax': utils.safe_cast(max_latency, int, 0) } except IndexError: pass @@ -524,22 +520,22 @@ class IxiaPppoeClientScenario(object): avg_latency_ns = sum( [int(flow['Store-Forward_Avg_latency_ns']) for flow in samples if flow['IP_Priority'] == priority]) / prio_flows_num - min_latency_ns = sum( + min_latency_ns = min( [int(flow['Store-Forward_Min_latency_ns']) for flow in samples - if flow['IP_Priority'] == priority]) / prio_flows_num - max_latency_ns = sum( + if flow['IP_Priority'] == priority]) + max_latency_ns = max( [int(flow['Store-Forward_Max_latency_ns']) for flow in samples - if flow['IP_Priority'] == priority]) / prio_flows_num + if flow['IP_Priority'] == priority]) tx_throughput = float(tx_frames) / duration rx_throughput = float(rx_frames) / duration results[priority] = { - 'in_packets': rx_frames, - 'out_packets': tx_frames, + 'InPackets': rx_frames, + 'OutPackets': tx_frames, 'RxThroughput': round(rx_throughput, 3), 'TxThroughput': round(tx_throughput, 3), - 'avg_latency_ns': utils.safe_cast(avg_latency_ns, int, 0), - 'min_latency_ns': utils.safe_cast(min_latency_ns, int, 0), - 'max_latency_ns': utils.safe_cast(max_latency_ns, int, 0) + 'LatencyAvg': utils.safe_cast(avg_latency_ns, int, 0), + 'LatencyMin': utils.safe_cast(min_latency_ns, int, 0), + 'LatencyMax': utils.safe_cast(max_latency_ns, int, 0) } return results @@ -600,38 +596,34 @@ class IxiaPppoeClientScenario(object): flows_stats, flow, 'Store-Forward_Avg_latency_ns')) for flow in port_flow_map[port_num]]) / len(port_flow_map[port_num]) min_latency = \ - sum([float(self.get_flow_id_data( + min([float(self.get_flow_id_data( flows_stats, flow, 'Store-Forward_Min_latency_ns')) - for flow in port_flow_map[port_num]]) / len(port_flow_map[port_num]) + for flow in port_flow_map[port_num]]) max_latency = \ - sum([float(self.get_flow_id_data( + max([float(self.get_flow_id_data( flows_stats, flow, 'Store-Forward_Max_latency_ns')) - for flow in port_flow_map[port_num]]) / len(port_flow_map[port_num]) + for flow in port_flow_map[port_num]]) samples[port_name] = { - 'rx_throughput_kps': float(ports_stats[port_num]['Rx_Rate_Kbps']), - 'tx_throughput_kps': float(ports_stats[port_num]['Tx_Rate_Kbps']), - 'rx_throughput_mbps': float(ports_stats[port_num]['Rx_Rate_Mbps']), - 'tx_throughput_mbps': float(ports_stats[port_num]['Tx_Rate_Mbps']), 'RxThroughputBps': float(ports_stats[port_num]['Bytes_Rx']) / duration, 'TxThroughputBps': float(ports_stats[port_num]['Bytes_Tx']) / duration, - 'in_packets': int(ports_stats[port_num]['Valid_Frames_Rx']), - 'out_packets': int(ports_stats[port_num]['Frames_Tx']), - 'in_bytes': int(ports_stats[port_num]['Bytes_Rx']), - 'out_bytes': int(ports_stats[port_num]['Bytes_Tx']), + 'InPackets': int(ports_stats[port_num]['Valid_Frames_Rx']), + 'OutPackets': int(ports_stats[port_num]['Frames_Tx']), + 'InBytes': int(ports_stats[port_num]['Bytes_Rx']), + 'OutBytes': int(ports_stats[port_num]['Bytes_Tx']), 'RxThroughput': float(ports_stats[port_num]['Valid_Frames_Rx']) / duration, 'TxThroughput': float(ports_stats[port_num]['Frames_Tx']) / duration, - 'Store-Forward_Avg_latency_ns': utils.safe_cast(avg_latency, int, 0), - 'Store-Forward_Min_latency_ns': utils.safe_cast(min_latency, int, 0), - 'Store-Forward_Max_latency_ns': utils.safe_cast(max_latency, int, 0) + 'LatencyAvg': utils.safe_cast(avg_latency, int, 0), + 'LatencyMin': utils.safe_cast(min_latency, int, 0), + 'LatencyMax': utils.safe_cast(max_latency, int, 0) } if port_subs_stats: samples[port_name].update( - {'sessions_up': int(port_subs_stats[0]['Sessions_Up']), - 'sessions_down': int(port_subs_stats[0]['Sessions_Down']), - 'sessions_not_started': int(port_subs_stats[0]['Sessions_Not_Started']), - 'sessions_total': int(port_subs_stats[0]['Sessions_Total'])} + {'SessionsUp': int(port_subs_stats[0]['Sessions_Up']), + 'SessionsDown': int(port_subs_stats[0]['Sessions_Down']), + 'SessionsNotStarted': int(port_subs_stats[0]['Sessions_Not_Started']), + 'SessionsTotal': int(port_subs_stats[0]['Sessions_Total'])} ) except IndexError: |