diff options
author | Serhiy Pshyk <serhiyx.pshyk@intel.com> | 2019-01-31 14:23:59 +0000 |
---|---|---|
committer | Serhiy Pshyk <serhiyx.pshyk@intel.com> | 2019-01-31 14:31:23 +0000 |
commit | 11b0b1e3cfcc4b09008c33903d4bf70eb96beba7 (patch) | |
tree | fa1efca8d7042217a27c64e9c09c86b7c647e5bc /yardstick/network_services/traffic_profile | |
parent | 79cf0db4a45b64f2663468b7ea303b9c06fb2010 (diff) |
Add rate 'resolution' option for IXIA rfc2544 test
Rate resolution value is compared with the difference between
the rates in two consecutive iterations. If the difference
is smaller than the resolution, the test stops.
JIRA: YYARDSTICK-1592
Change-Id: I3f203d33d1688734a59a8f62f31e3ad238bc63b0
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile')
-rw-r--r-- | yardstick/network_services/traffic_profile/ixia_rfc2544.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/yardstick/network_services/traffic_profile/ixia_rfc2544.py b/yardstick/network_services/traffic_profile/ixia_rfc2544.py index 35038891b..7df590fb3 100644 --- a/yardstick/network_services/traffic_profile/ixia_rfc2544.py +++ b/yardstick/network_services/traffic_profile/ixia_rfc2544.py @@ -167,6 +167,10 @@ 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 execute_traffic(self, traffic_generator, ixia_obj=None, mac=None): mac = {} if mac is None else mac first_run = self.first_run @@ -176,17 +180,16 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): self.max_rate = self.rate self.min_rate = 0.0 else: - self.rate = round(float(self.max_rate + self.min_rate) / 2.0, - self.RATE_ROUND) + self.rate = self._get_next_rate() traffic = self._get_ixia_traffic_profile(self.full_profile, mac) self._ixia_traffic_generate(traffic, ixia_obj) return first_run def get_drop_percentage(self, samples, tol_min, tolerance, precision, - first_run=False): + resolution, first_run=False): completed = False - drop_percent = 100 + drop_percent = 100.0 num_ifaces = len(samples) duration = self.config.duration in_packets_sum = sum( @@ -217,6 +220,14 @@ class IXIARFC2544Profile(trex_traffic_profile.TrexProfile): else: completed = True + next_rate = self._get_next_rate() + if abs(next_rate - self.rate) < resolution: + LOG.debug("rate=%s, next_rate=%s, resolution=%s", self.rate, + next_rate, resolution) + # stop test if the difference between the rate transmission + # in two iterations is smaller than the value of the resolution + completed = True + LOG.debug("tolerance=%s, tolerance_precision=%s drop_percent=%s " "completed=%s", tolerance, precision, drop_percent, completed) |