aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/TrafficGenerator.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2018-07-30 17:48:50 +0200
committerPeter Mikus <pmikus@cisco.com>2018-08-22 06:40:35 +0000
commit56fe9e512019d90a5647f4a244ffb8b6f6ff9c47 (patch)
tree8aa98f5422767232b72e71ac577f8a0e3b2c9777 /resources/libraries/python/TrafficGenerator.py
parentbc49817b524f0478900da35aaec5f8418e698392 (diff)
CSIT-1222: Do two doublings in external MLRsearch
Make number of doublings configurable, keep Python default at 1, set Robot default to 2. Also make docstring types unique (pylint was complaining about classes and modules having the same name). Increase MLRsearch version to 0.2.0. Change-Id: Ib846032e79ff52994503c0cfef2f86655502c275 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/TrafficGenerator.py')
-rw-r--r--resources/libraries/python/TrafficGenerator.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 8acf1eb28b..1398072ce1 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -613,7 +613,7 @@ class OptimizedSearch(object):
maximum_transmit_rate, packet_loss_ratio=0.005,
final_relative_width=0.005, final_trial_duration=30.0,
initial_trial_duration=1.0, number_of_intermediate_phases=2,
- timeout=720.0):
+ timeout=720.0, doublings=1):
"""Setup initialized TG, perform optimized search, return intervals.
:param frame_size: Frame size identifier or value [B].
@@ -633,6 +633,9 @@ class OptimizedSearch(object):
to perform before the final phase [1].
:param timeout: The search will fail itself when not finished
before this overall time [s].
+ :param doublings: How many doublings to do in external search step.
+ Default 1 is suitable for fairly stable tests,
+ less stable tests might get better overal duration with 2 or more.
:type frame_size: str or int
:type traffic_type: str
:type minimum_transmit_rate: float
@@ -643,6 +646,7 @@ class OptimizedSearch(object):
:type initial_trial_duration: float
:type number_of_intermediate_phases: int
:type timeout: float
+ :type doublings: int
:returns: Structure containing narrowed down NDR and PDR intervals
and their measurements.
:rtype: NdrPdrResult
@@ -657,7 +661,8 @@ class OptimizedSearch(object):
measurer=tg_instance, final_trial_duration=final_trial_duration,
final_relative_width=final_relative_width,
number_of_intermediate_phases=number_of_intermediate_phases,
- initial_trial_duration=initial_trial_duration, timeout=timeout)
+ initial_trial_duration=initial_trial_duration, timeout=timeout,
+ doublings=doublings)
result = algorithm.narrow_down_ndr_and_pdr(
minimum_transmit_rate, maximum_transmit_rate, packet_loss_ratio)
return result