From 0a0b9d81b7e46ac485d66e9aeb2c8def639680c6 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Thu, 10 May 2018 19:27:30 +0200 Subject: CSIT-992: Fix intermediate phases MDR parameter Also add TODOs and improve comments. Change-Id: I50bd652c83c272c3f7662dd487ab617be2b7de08 Signed-off-by: Vratko Polak --- resources/libraries/python/TrafficGenerator.py | 11 ++++++----- .../libraries/python/search/OptimizedSearchAlgorithm.py | 12 +++++++++--- .../libraries/robot/performance/performance_utils.robot | 12 ++++++------ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index bf6383e52a..816b946381 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -612,7 +612,8 @@ class OptimizedSearch(object): frame_size, traffic_type, minimum_transmit_rate, maximum_transmit_rate, packet_loss_ratio=0.005, final_relative_width=0.005, final_trial_duration=30.0, - initial_trial_duration=1.0, intermediate_phases=2, timeout=600.0): + initial_trial_duration=1.0, number_of_intermediate_phases=2, + timeout=600.0): """Setup initialized TG, perform optimized search, return intervals. :param frame_size: Frame size identifier or value [B]. @@ -628,8 +629,8 @@ class OptimizedSearch(object): :param final_trial_duration: Trial duration for the final phase [s]. :param initial_trial_duration: Trial duration for the initial phase and also for the first intermediate phase [s]. - :param intermediate_phases: Number of intermediate phases to perform - before the final phase [1]. + :param number_of_intermediate_phases: Number of intermediate phases + to perform before the final phase [1]. :param timeout: The search will fail itself when not finished before this overall time [s]. :type frame_size: str or int @@ -640,7 +641,7 @@ class OptimizedSearch(object): :type final_relative_width: float :type final_trial_duration: float :type initial_trial_duration: float - :type intermediate_phases: int + :type number_of_intermediate_phases: int :type timeout: float :returns: Structure containing narrowed down intervals and their measurements. @@ -655,7 +656,7 @@ class OptimizedSearch(object): algorithm = OptimizedSearchAlgorithm( tg_instance, final_trial_duration=final_trial_duration, final_relative_width=final_relative_width, - intermediate_phases=intermediate_phases, + number_of_intermediate_phases=number_of_intermediate_phases, initial_trial_duration=initial_trial_duration, timeout=timeout) result = algorithm.narrow_down_ndr_and_pdr( minimum_transmit_rate, maximum_transmit_rate, packet_loss_ratio) diff --git a/resources/libraries/python/search/OptimizedSearchAlgorithm.py b/resources/libraries/python/search/OptimizedSearchAlgorithm.py index 0d3eacc937..c96ab444e2 100644 --- a/resources/libraries/python/search/OptimizedSearchAlgorithm.py +++ b/resources/libraries/python/search/OptimizedSearchAlgorithm.py @@ -73,7 +73,13 @@ class OptimizedSearchAlgorithm(AbstractSearchAlgorithm): or all of the following is true: Both bounds are valid, bound bounds are measured at the current phase trial duration, interval width is less than the width goal - for current phase.""" + for current phase. + + TODO: Reviwew and update this docstring according to rst docs. + TODO: Initial phase: Larger min width and search up on zero. + TODO: Support configurable number of Packet Loss Ratios. + TODO: Rename to MultipleDropRateSearch (or MultipleLossRatioSearch). + """ class ProgressState(object): """Structure containing data to be passed around in recursion.""" @@ -439,7 +445,7 @@ class OptimizedSearchAlgorithm(AbstractSearchAlgorithm): continue # If we are hitting maximum_transmit_rate, # it is still worth narrowing width, - # hoping large enough Df will happen. + # hoping large enough loss fraction will happen. # But if we are hitting the minimal rate (at current duration), # no additional measurement will help with that, # so we can stop narrowing in this phase. @@ -473,7 +479,7 @@ class OptimizedSearchAlgorithm(AbstractSearchAlgorithm): logging.info("re-measuring PDR lower bound") self._measure_and_update_state(state, pdr_lo.target_tr) continue - # Except when lower bounds have high Df, in that case + # Except when lower bounds have high loss fraction, in that case # we do not need to re-measure _upper_ bounds. if ndr_hi.duration < state.duration and ndr_rel_width > 0.0: logging.info("re-measuring NDR upper bound") diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index 1bb989373f..f48003ff14 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -360,7 +360,7 @@ | | ... | Find boundaries for RFC2544 compatible NDR and PDR values | | ... | using an optimized search algorithm. | | ... | Display results as formatted test message. -| | ... | Fail if a resulting lower bound has too high drop fraction. +| | ... | Fail if a resulting lower bound has too high loss fraction. | | ... | Proceed with Perform additional measurements based on NDRPDR result. | | ... | TODO: Should the trial duration of the additional | | ... | measurements be configurable? @@ -370,7 +370,7 @@ | | ... | - topology_type - Topology type. Type: string | | ... | - minimum_transmit_rate - Lower limit of search [pps]. Type: float | | ... | - maximum_transmit_rate - Upper limit of search [pps]. Type: float -| | ... | - packet_drop_ratio - Accepted loss during search. Type: float +| | ... | - packet_loss_ratio - Accepted loss during search. Type: float | | ... | - final_relative_width - Maximal width multiple of upper. Type: float | | ... | - final_trial_duration - Duration of final trials [s]. Type: float | | ... | - initial_trial_duration - Duration of initial trials [s]. Type: float @@ -467,7 +467,7 @@ | Check NDRPDR interval validity | | [Documentation] -| | ... | Extract drop fraction of lower bound of the interval. +| | ... | Extract loss ratio of lower bound of the interval. | | ... | Fail if it does not reach the allowed value. | | ... | | ... | *Arguments:* @@ -481,10 +481,10 @@ | | ... | | [Arguments] | ${interval} | ${packet_loss_ratio}=${0.0} | | ... -| | ${lower_bound_df}= | Set Variable | ${interval.measured_low.drop_fraction} -| | Return From Keyword If | ${lower_bound_df} <= ${packet_loss_ratio} +| | ${lower_bound_lf}= | Set Variable | ${interval.measured_low.loss_fraction} +| | Return From Keyword If | ${lower_bound_lf} <= ${packet_loss_ratio} | | ${messagge}= | Catenate | SEPARATOR=${SPACE} -| | ... | Lower bound fraction ${lower_bound_df} +| | ... | Lower bound fraction ${lower_bound_lf} | | ... | does not reach ${packet_loss_ratio}. | | Fail | ${message} -- cgit 1.2.3-korg