summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/results/results_constants.py4
-rwxr-xr-xtools/pkt_gen/ixia/ixia.py5
-rwxr-xr-xtools/pkt_gen/ixnet/ixnet.py3
3 files changed, 11 insertions, 1 deletions
diff --git a/core/results/results_constants.py b/core/results/results_constants.py
index 8f139f14..fcf068b7 100644
--- a/core/results/results_constants.py
+++ b/core/results/results_constants.py
@@ -37,6 +37,7 @@ class ResultsConstants(object):
MIN_LATENCY_NS = 'min_latency_ns'
MAX_LATENCY_NS = 'max_latency_ns'
AVG_LATENCY_NS = 'avg_latency_ns'
+ FRAME_LOSS_PERCENT = 'frame_loss_percent'
#Burst traffic
TX_FRAMES = 'tx_frames'
RX_FRAMES = 'rx_frames'
@@ -79,4 +80,5 @@ class ResultsConstants(object):
ResultsConstants.THROUGHPUT_RX_PERCENT,
ResultsConstants.MIN_LATENCY_NS,
ResultsConstants.MAX_LATENCY_NS,
- ResultsConstants.AVG_LATENCY_NS]
+ ResultsConstants.AVG_LATENCY_NS,
+ ResultsConstants.FRAME_LOSS_PERCENT]
diff --git a/tools/pkt_gen/ixia/ixia.py b/tools/pkt_gen/ixia/ixia.py
index 10ed1fb2..b9b3dd17 100755
--- a/tools/pkt_gen/ixia/ixia.py
+++ b/tools/pkt_gen/ixia/ixia.py
@@ -289,6 +289,10 @@ class Ixia(trafficgen.ITrafficGenerator):
"""
assert len(result) == 8 # fail-fast if underlying Tcl code changes
+ if float(result[0]) == 0:
+ loss_rate = 100
+ else:
+ loss_rate = (float(result[0]) - float(result[1])) / float(result[0]) * 100
result_dict = OrderedDict()
# drop the first 4 elements as we don't use/need them. In
# addition, IxExplorer does not support latency or % line rate
@@ -297,6 +301,7 @@ class Ixia(trafficgen.ITrafficGenerator):
result_dict[ResultsConstants.TX_RATE_FPS] = result[5]
result_dict[ResultsConstants.THROUGHPUT_RX_MBPS] = result[6]
result_dict[ResultsConstants.TX_RATE_MBPS] = result[7]
+ result_dict[ResultsConstants.FRAME_LOSS_PERCENT] = loss_rate
result_dict[ResultsConstants.TX_RATE_PERCENT] = \
ResultsConstants.UNKNOWN_VALUE
result_dict[ResultsConstants.THROUGHPUT_RX_PERCENT] = \
diff --git a/tools/pkt_gen/ixnet/ixnet.py b/tools/pkt_gen/ixnet/ixnet.py
index 96936e14..c8dbb3d1 100755
--- a/tools/pkt_gen/ixnet/ixnet.py
+++ b/tools/pkt_gen/ixnet/ixnet.py
@@ -375,6 +375,7 @@ class IxNet(trafficgen.ITrafficGenerator):
results[ResultsConstants.THROUGHPUT_RX_MBPS] = row[6]
results[ResultsConstants.TX_RATE_PERCENT] = row[3]
results[ResultsConstants.THROUGHPUT_RX_PERCENT] = row[4]
+ results[ResultsConstants.FRAME_LOSS_PERCENT] = row[10]
results[ResultsConstants.MIN_LATENCY_NS] = row[11]
results[ResultsConstants.MAX_LATENCY_NS] = row[12]
results[ResultsConstants.AVG_LATENCY_NS] = row[13]
@@ -484,6 +485,7 @@ class IxNet(trafficgen.ITrafficGenerator):
"""
results = OrderedDict()
results[ResultsConstants.B2B_FRAMES] = 0
+ results[ResultsConstants.B2B_FRAME_LOSS_PERCENT] = 100
with open(path, 'r') as in_file:
reader = csv.reader(in_file, delimiter=',')
@@ -495,6 +497,7 @@ class IxNet(trafficgen.ITrafficGenerator):
if int(row[12]) > \
int(results[ResultsConstants.B2B_FRAMES]):
results[ResultsConstants.B2B_FRAMES] = int(row[12])
+ results[ResultsConstants.B2B_FRAME_LOSS_PERCENT] = float(row[14])
return results