aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/TrafficGenerator.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2018-05-28 11:53:45 +0200
committerVratko Polak <vrpolak@cisco.com>2018-06-18 12:20:18 +0200
commita9f251c649a5dea7428a43dc24380077a72dacba (patch)
treee56e2cae2970968efe5f5ca285feb9f3b8ce2bbc /resources/libraries/python/TrafficGenerator.py
parent938a0c9cec6d2177e098653ad398372fb482c36f (diff)
CSIT-986: Implement proposed MDR improvements
+ Use first intermediate with goal in initial phase. + Measure above MRR if that got zero loss. + Always prioritizes NDR in internal search. + Rename classes. + Copy code for standalone PyPI publishing. - Original files will be deleted after publish. Change-Id: I5169d602d1e5e35a1894645cd52e70d791871608 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/TrafficGenerator.py')
-rw-r--r--resources/libraries/python/TrafficGenerator.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 816b946381..ee65c1bf2a 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -22,8 +22,8 @@ from .ssh import SSH
from .topology import NodeType
from .topology import NodeSubTypeTG
from .topology import Topology
-from .search.AbstractRateProvider import AbstractRateProvider
-from .search.OptimizedSearchAlgorithm import OptimizedSearchAlgorithm
+from .search.AbstractMeasurer import AbstractMeasurer
+from .search.MultipleLossRatioSearch import MultipleLossRatioSearch
from .search.ReceiveRateMeasurement import ReceiveRateMeasurement
__all__ = ['TGDropRateSearchImpl', 'TrafficGenerator', 'OptimizedSearch']
@@ -101,7 +101,7 @@ class TGDropRateSearchImpl(DropRateSearch):
return tg_instance.get_latency_int()
-class TrafficGenerator(AbstractRateProvider):
+class TrafficGenerator(AbstractMeasurer):
"""Traffic Generator.
FIXME: Describe API."""
@@ -643,7 +643,7 @@ class OptimizedSearch(object):
:type initial_trial_duration: float
:type number_of_intermediate_phases: int
:type timeout: float
- :returns: Structure containing narrowed down intervals
+ :returns: Structure containing narrowed down NDR and PDR intervals
and their measurements.
:rtype: NdrPdrResult
:raises RuntimeError: If total duration is larger than timeout.
@@ -653,8 +653,8 @@ class OptimizedSearch(object):
tg_instance = BuiltIn().get_library_instance(
'resources.libraries.python.TrafficGenerator')
tg_instance.set_rate_provider_defaults(frame_size, traffic_type)
- algorithm = OptimizedSearchAlgorithm(
- tg_instance, final_trial_duration=final_trial_duration,
+ algorithm = MultipleLossRatioSearch(
+ 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)