self._search_result = None
self._search_result_rate = None
+ @abstractmethod
+ def get_latency(self):
+ """Return min/avg/max latency.
+
+ :return: Latency stats.
+ :rtype: list
+ """
+ pass
+
@abstractmethod
def measure_loss(self, rate, frame_size, loss_acceptance,
loss_acceptance_type, traffic_type):
:rtype: boolean
"""
# Return False if not all elements of the iterable are True.
- return not all(res_list)
+ return all(res_list)
def _get_res_based_on_search_type(self, res_list):
"""Return result of search based on search evaluation type.
def verify_search_result(self):
"""Fail if search was not successful.
- :return: Result rate.
- :rtype: float
+ :return: Result rate and latency stats.
+ :rtype: tuple
"""
if self._search_result == SearchResults.FAILURE:
raise Exception('Search FAILED')
elif self._search_result in [SearchResults.SUCCESS,
SearchResults.SUSPICIOUS]:
- return self._search_result_rate
+ return self._search_result_rate, self.get_latency()
def binary_search(self, b_min, b_max, traffic_type, skip_max_rate=False):
"""Binary search of rate with loss below acceptance criteria.