aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services
diff options
context:
space:
mode:
authorVolodymyr Mytnyk <volodymyrx.mytnyk@intel.com>2019-02-11 16:43:18 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-02-11 16:43:18 +0000
commitfa0c26a8af32e98a8486772e3a98b6185d68edba (patch)
tree5f20e8cd54e671df1e10c079358a71e08ec9a632 /yardstick/network_services
parentda8b4002029522c712c298a256b15e75bf3171a3 (diff)
parent4d000298119c0de055e012e27e76f54327df2251 (diff)
Merge "Add IXIA Tx/Rx Bytes stats into results"
Diffstat (limited to 'yardstick/network_services')
-rw-r--r--yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py2
-rw-r--r--yardstick/network_services/traffic_profile/ixia_rfc2544.py20
-rw-r--r--yardstick/network_services/traffic_profile/rfc2544.py8
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py8
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_trex.py2
5 files changed, 40 insertions, 0 deletions
diff --git a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
index d0feedf03..cb8ba1771 100644
--- a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
+++ b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
@@ -100,6 +100,8 @@ class IxNextgen(object): # pragma: no cover
"Rx_Rate_Kbps": 'Rx. Rate (Kbps)',
"Tx_Rate_Mbps": 'Tx. Rate (Mbps)',
"Rx_Rate_Mbps": 'Rx. Rate (Mbps)',
+ "Bytes_Tx": 'Bytes Tx.',
+ "Bytes_Rx": 'Bytes Rx.'
}
LATENCY_NAME_MAP = {
diff --git a/yardstick/network_services/traffic_profile/ixia_rfc2544.py b/yardstick/network_services/traffic_profile/ixia_rfc2544.py
index c4664a36a..aded2d347 100644
--- a/yardstick/network_services/traffic_profile/ixia_rfc2544.py
+++ b/yardstick/network_services/traffic_profile/ixia_rfc2544.py
@@ -209,8 +209,16 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
[samples[iface]['in_packets'] for iface in samples])
out_packets_sum = sum(
[samples[iface]['out_packets'] for iface in samples])
+ in_bytes_sum = sum(
+ [samples[iface]['in_bytes'] for iface in samples])
+ out_bytes_sum = sum(
+ [samples[iface]['out_bytes'] for iface in samples])
rx_throughput = round(float(in_packets_sum) / duration, 3)
tx_throughput = round(float(out_packets_sum) / duration, 3)
+ # Rx throughput in Bps
+ rx_throughput_bps = round(float(in_bytes_sum) / duration, 3)
+ # Tx throughput in Bps
+ tx_throughput_bps = round(float(out_bytes_sum) / duration, 3)
packet_drop = abs(out_packets_sum - in_packets_sum)
try:
@@ -262,6 +270,8 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
samples['TxThroughput'] = tx_throughput
samples['RxThroughput'] = rx_throughput
+ samples['TxThroughputBps'] = tx_throughput_bps
+ samples['RxThroughputBps'] = rx_throughput_bps
samples['DropPercentage'] = drop_percent
samples['latency_ns_avg'] = latency_ns_avg
samples['latency_ns_min'] = latency_ns_min
@@ -351,8 +361,16 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile):
[samples[iface]['in_packets'] for iface in samples])
out_packets_sum = sum(
[samples[iface]['out_packets'] for iface in samples])
+ in_bytes_sum = sum(
+ [samples[iface]['in_bytes'] for iface in samples])
+ out_bytes_sum = sum(
+ [samples[iface]['out_bytes'] for iface in samples])
rx_throughput = round(float(in_packets_sum) / duration, 3)
tx_throughput = round(float(out_packets_sum) / duration, 3)
+ # Rx throughput in Bps
+ rx_throughput_bps = round(float(in_bytes_sum) / duration, 3)
+ # Tx throughput in Bps
+ tx_throughput_bps = round(float(out_bytes_sum) / duration, 3)
sum_packet_drop = abs(out_packets_sum - in_packets_sum)
try:
@@ -374,6 +392,8 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile):
samples['TxThroughput'] = tx_throughput
samples['RxThroughput'] = rx_throughput
+ samples['TxThroughputBps'] = tx_throughput_bps
+ samples['RxThroughputBps'] = rx_throughput_bps
samples['DropPercentage'] = sum_drop_percent
samples['latency_ns_avg'] = latency_ns_avg
samples['latency_ns_min'] = latency_ns_min
diff --git a/yardstick/network_services/traffic_profile/rfc2544.py b/yardstick/network_services/traffic_profile/rfc2544.py
index 86ef0db5e..b838bf814 100644
--- a/yardstick/network_services/traffic_profile/rfc2544.py
+++ b/yardstick/network_services/traffic_profile/rfc2544.py
@@ -278,10 +278,16 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
in_pkt_end = sum(port['in_packets'] for port in samples[-1].values())
out_pkt_ini = sum(port['out_packets'] for port in samples[0].values())
in_pkt_ini = sum(port['in_packets'] for port in samples[0].values())
+ in_bytes_ini = sum(port['in_bytes'] for port in samples[0].values())
+ out_bytes_ini = sum(port['out_bytes'] for port in samples[0].values())
+ in_bytes_end = sum(port['in_bytes'] for port in samples[-1].values())
+ out_bytes_end = sum(port['out_bytes'] for port in samples[-1].values())
time_diff = (list(samples[-1].values())[0]['timestamp'] -
list(samples[0].values())[0]['timestamp']).total_seconds()
out_packets = out_pkt_end - out_pkt_ini
in_packets = in_pkt_end - in_pkt_ini
+ out_bytes = out_bytes_end - out_bytes_ini
+ in_bytes = in_bytes_end - in_bytes_ini
tx_rate_fps = float(out_packets) / time_diff
rx_rate_fps = float(in_packets) / time_diff
drop_percent = 100.0
@@ -320,6 +326,8 @@ class RFC2544Profile(trex_traffic_profile.TrexProfile):
output = {
'TxThroughput': tx_rate_fps,
'RxThroughput': rx_rate_fps,
+ 'RxThroughputBps': round(float(in_bytes) / time_diff, 3),
+ 'TxThroughputBps': round(float(out_bytes) / time_diff, 3),
'CurrentDropPercentage': drop_percent,
'Throughput': throughput,
'DropPercentage': self.drop_percent_max,
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 599d29756..5d69fc8c8 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
@@ -84,8 +84,12 @@ class IxiaBasicScenario(object):
'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]),
'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),
@@ -608,8 +612,12 @@ class IxiaPppoeClientScenario(object):
'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']),
'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),
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_trex.py b/yardstick/network_services/vnf_generic/vnf/tg_trex.py
index 3011c60a3..0cb66a714 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_trex.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_trex.py
@@ -179,6 +179,8 @@ class TrexResourceHelper(ClientResourceHelper):
'tx_throughput_bps': float(port_stats.get('tx_bps', 0.0)),
'in_packets': int(port_stats.get('ipackets', 0)),
'out_packets': int(port_stats.get('opackets', 0)),
+ 'in_bytes': int(port_stats.get('ibytes', 0)),
+ 'out_bytes': int(port_stats.get('obytes', 0)),
'timestamp': timestamp
}