aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/MLRsearch/trimmed_stat.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2023-10-19 10:47:48 +0200
committerVratko Polak <vrpolak@cisco.com>2023-10-19 09:38:33 +0000
commit7a27faf661cf54a84ef4ee0984e12879a223ce32 (patch)
tree07b33102eaea074c74a53264934c3fbfdfd4b96d /resources/libraries/python/MLRsearch/trimmed_stat.py
parent351c5e1e92f31465e1a4523d3fe9b7701457a503 (diff)
feat(MLRseach): Update to v8 conditional throughput
Hopefully, with CSIT config values, PDR lower than NDR will not happen. + Bump duration_sum default to an odd number, so users are not surprised by not seeing standard median behavior. For CSIT this should not matter, overheads hide ties and number of trials (at least for STL) should stay the same. Change-Id: Id7130f978c31e71227499612424007c473bcfac2 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/MLRsearch/trimmed_stat.py')
-rw-r--r--resources/libraries/python/MLRsearch/trimmed_stat.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/resources/libraries/python/MLRsearch/trimmed_stat.py b/resources/libraries/python/MLRsearch/trimmed_stat.py
index 0076644aa3..088e8beaf8 100644
--- a/resources/libraries/python/MLRsearch/trimmed_stat.py
+++ b/resources/libraries/python/MLRsearch/trimmed_stat.py
@@ -57,22 +57,21 @@ class TrimmedStat(LoadStats):
def conditional_throughput(self) -> Optional[DiscreteLoad]:
"""Compute conditional throughput from the load.
- Target stat has dur_rat_sum and good_long.
- The code here adds intended load and handles the case min load is hit.
- If min load is not a lower bound, None is returned.
+ The conditional throughput has the same semantics as load,
+ so if load is unicirectional and user wants bidirectional
+ throughput, the manager has to compensate.
+
+ This only works correctly if the self load is a lower bound
+ for the self target, but this method does not check that.
+ Its should not matter, as MLRsearch controller only returns
+ the relevant lower bounds to the manager.
:return: Conditional throughput assuming self is a relevant lower bound.
:rtype: Optional[DiscreteLoad]
:raises RuntimeError: If target is unclear or load is spurious.
"""
target = list(self.target_to_stat.keys())[0]
- _, pes = self.estimates(target)
- if not pes:
- if int(self):
- raise RuntimeError(f"Not a lower bound: {self}")
- return None
- # TODO: Verify self is really the clo?
stat = self.target_to_stat[target]
- loss_ratio = stat.dur_rat_sum / stat.good_long
+ loss_ratio = stat.pessimistic_loss_ratio()
ret = self * (1.0 - loss_ratio)
return ret