aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/traffic_profile/ixia_rfc2544.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/network_services/traffic_profile/ixia_rfc2544.py')
-rw-r--r--yardstick/network_services/traffic_profile/ixia_rfc2544.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/yardstick/network_services/traffic_profile/ixia_rfc2544.py b/yardstick/network_services/traffic_profile/ixia_rfc2544.py
index 89bb3ef7a..c4664a36a 100644
--- a/yardstick/network_services/traffic_profile/ixia_rfc2544.py
+++ b/yardstick/network_services/traffic_profile/ixia_rfc2544.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016-2017 Intel Corporation
+# Copyright (c) 2016-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
UPLINK = 'uplink'
DOWNLINK = 'downlink'
DROP_PERCENT_ROUND = 6
- RATE_ROUND = 5
STATUS_SUCCESS = "Success"
STATUS_FAIL = "Failure"
@@ -171,9 +170,18 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
self.ports = [port for port in port_generator()]
- def _get_next_rate(self):
- rate = round(float(self.max_rate + self.min_rate)/2.0, self.RATE_ROUND)
- return rate
+ def _get_framesize(self):
+ framesizes = []
+ traffic = self._get_ixia_traffic_profile(self.full_profile)
+ for v in traffic.values():
+ framesize = v['outer_l2']['framesize']
+ for size in (s for s, w in framesize.items() if int(w) != 0):
+ framesizes.append(size)
+ if len(set(framesizes)) == 0:
+ return ''
+ elif len(set(framesizes)) == 1:
+ return framesizes[0]
+ return 'IMIX'
def execute_traffic(self, traffic_generator, ixia_obj=None, mac=None):
mac = {} if mac is None else mac
@@ -225,6 +233,7 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
else:
completed = True
+ last_rate = self.rate
next_rate = self._get_next_rate()
if abs(next_rate - self.rate) < resolution:
LOG.debug("rate=%s, next_rate=%s, resolution=%s", self.rate,
@@ -257,6 +266,8 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile):
samples['latency_ns_avg'] = latency_ns_avg
samples['latency_ns_min'] = latency_ns_min
samples['latency_ns_max'] = latency_ns_max
+ samples['Rate'] = last_rate
+ samples['PktSize'] = self._get_framesize()
return completed, samples
@@ -332,6 +343,7 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile):
sum_drop_percent = 100
num_ifaces = len(samples)
duration = self.config.duration
+ last_rate = self.rate
priority_stats = samples.pop('priority_stats')
priority_stats = self._get_prio_flows_drop_percentage(priority_stats)
summary_subs_stats = self._get_summary_pppoe_subs_counters(samples)
@@ -367,6 +379,8 @@ class IXIARFC2544PppoeScenarioProfile(IXIARFC2544Profile):
samples['latency_ns_min'] = latency_ns_min
samples['latency_ns_max'] = latency_ns_max
samples['priority'] = priority_stats
+ samples['Rate'] = last_rate
+ samples['PktSize'] = self._get_framesize()
samples.update(summary_subs_stats)
if tc_rfc2544_opts: