+ minimum_transmit_rate, maximum_transmit_rate, packet_loss_ratio
+ )
+ return result
+
+ @staticmethod
+ def perform_soak_search(
+ frame_size, traffic_profile, minimum_transmit_rate,
+ maximum_transmit_rate, plr_target=1e-7, tdpt=0.1,
+ initial_count=50, timeout=1800.0, trace_enabled=False,
+ traffic_directions=2):
+ """Setup initialized TG, perform soak search, return avg and stdev.
+
+ :param frame_size: Frame size identifier or value [B].
+ :param traffic_profile: Module name as a traffic profile identifier.
+ See resources/traffic_profiles/trex for implemented modules.
+ :param minimum_transmit_rate: Minimal uni-directional
+ target transmit rate [pps].
+ :param maximum_transmit_rate: Maximal uni-directional
+ target transmit rate [pps].
+ :param plr_target: Fraction of packets lost to achieve [1].
+ :param tdpt: Trial duration per trial.
+ The algorithm linearly increases trial duration with trial number,
+ this is the increment between succesive trials, in seconds.
+ :param initial_count: Offset to apply before the first trial.
+ For example initial_count=50 makes first trial to be 51*tdpt long.
+ This is needed because initial "search" phase of integrator
+ takes significant time even without any trial results.
+ :param timeout: The search will stop after this overall time [s].
+ :param trace_enabled: True if trace enabled else False.
+ :param traffic_directions: Traffic is bi- (2) or uni- (1) directional.
+ Default: 2
+ :type frame_size: str or int
+ :type traffic_profile: str
+ :type minimum_transmit_rate: float
+ :type maximum_transmit_rate: float
+ :type plr_target: float
+ :type initial_count: int
+ :type timeout: float
+ :type trace_enabled: bool
+ :type traffic_directions: int
+ :returns: Average and stdev of estimated aggregate rate giving PLR.
+ :rtype: 2-tuple of float
+ """
+ minimum_transmit_rate *= traffic_directions
+ maximum_transmit_rate *= traffic_directions
+ tg_instance = BuiltIn().get_library_instance(
+ u"resources.libraries.python.TrafficGenerator"
+ )
+ tg_instance.set_rate_provider_defaults(
+ frame_size, traffic_profile, traffic_directions=traffic_directions)
+ algorithm = PLRsearch(
+ measurer=tg_instance, trial_duration_per_trial=tdpt,
+ packet_loss_ratio_target=plr_target,
+ trial_number_offset=initial_count, timeout=timeout,
+ trace_enabled=trace_enabled
+ )
+ result = algorithm.search(minimum_transmit_rate, maximum_transmit_rate)