From 057457312674210cbbdc950e9306568fdc9c7c3a Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Thu, 22 May 2025 10:37:28 +0200 Subject: [PATCH] fix(MLR): Improve name of success counter The RFC name for derived rate is forwarding rate, but proper English name for corresponding count is forwarded count. Not receive count, not forwarding count. Change-Id: I300507b81e45b21d81bd844ce6c1e8fce72177f2 Signed-off-by: Vratko Polak --- PyPI/MLRsearch/README.rst | 2 +- resources/libraries/python/MLRsearch/discrete_result.py | 4 ++-- .../MLRsearch/trial_measurement/measurement_result.py | 14 +++++++------- resources/libraries/python/TrafficGenerator.py | 4 ++-- .../libraries/robot/performance/performance_utils.robot | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/PyPI/MLRsearch/README.rst b/PyPI/MLRsearch/README.rst index bec1b7749e..b44ca283c0 100644 --- a/PyPI/MLRsearch/README.rst +++ b/PyPI/MLRsearch/README.rst @@ -83,7 +83,7 @@ This is the screen capture of interactive python interpreter ... intended_duration=intended_duration, ... intended_load=intended_load, ... offered_count=sent, - ... forwarding_count=received, + ... forwarded_count=received, ... ) ... >>> def print_dot(_): diff --git a/resources/libraries/python/MLRsearch/discrete_result.py b/resources/libraries/python/MLRsearch/discrete_result.py index 882b6081c6..2c3ff814f0 100644 --- a/resources/libraries/python/MLRsearch/discrete_result.py +++ b/resources/libraries/python/MLRsearch/discrete_result.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2025 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -68,7 +68,7 @@ class DiscreteResult(MeasurementResult): intended_load=result.intended_load, offered_count=result.offered_count, loss_count=result.loss_count, - forwarding_count=result.forwarding_count, + forwarded_count=result.forwarded_count, offered_duration=result.offered_duration, duration_with_overheads=result.duration_with_overheads, intended_count=result.intended_count, diff --git a/resources/libraries/python/MLRsearch/trial_measurement/measurement_result.py b/resources/libraries/python/MLRsearch/trial_measurement/measurement_result.py index 9dc1ccf5f1..8e0b104b7b 100644 --- a/resources/libraries/python/MLRsearch/trial_measurement/measurement_result.py +++ b/resources/libraries/python/MLRsearch/trial_measurement/measurement_result.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2025 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -65,7 +65,7 @@ class MeasurementResult: so that asymmetric trafic profiles are supported.""" loss_count: int = None """Number of packets transmitted but not received (transactions failed).""" - forwarding_count: int = None + forwarded_count: int = None """Number of packets successfully forwarded (transactions succeeded).""" # Optional primary quantities. offered_duration: float = None @@ -94,18 +94,18 @@ class MeasurementResult: else: self.duration_with_overheads = float(self.duration_with_overheads) self.intended_load = float(self.intended_load) - if self.forwarding_count is None: - self.forwarding_count = int(self.offered_count) - int( + if self.forwarded_count is None: + self.forwarded_count = int(self.offered_count) - int( self.loss_count ) else: - self.forwarding_count = int(self.forwarding_count) + self.forwarded_count = int(self.forwarded_count) if self.offered_count is None: - self.offered_count = self.forwarding_count + int(self.loss_count) + self.offered_count = self.forwarded_count + int(self.loss_count) else: self.offered_count = int(self.offered_count) if self.loss_count is None: - self.loss_count = self.offered_count - self.forwarding_count + self.loss_count = self.offered_count - self.forwarded_count else: self.loss_count = int(self.loss_count) if self.intended_count is None: diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index 3e0d854ded..60257ff8e4 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -1347,9 +1347,9 @@ class TrafficGenerator(AbstractMeasurer): rate=intended_load, async_call=False, ) - if result.receive_count >= 0: + if result.forwarded_count >= 0: break - logger.debug(f"Retry on negative count: {result.receive_count}") + logger.debug(f"Retry on negative count: {result.forwarded_count}") else: raise RuntimeError(f"Too many negative counts in a row!") logger.debug(f"Trial measurement result: {result!r}") diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot index 12d9488f8b..4be33e7288 100644 --- a/resources/libraries/robot/performance/performance_utils.robot +++ b/resources/libraries/robot/performance/performance_utils.robot @@ -509,7 +509,7 @@ | | | ... | ramp_up_rate=${ramp_up_rate} | | | # Out of several quantities for aborted traffic (duration stretching), | | | # the approximated receive rate is the best estimate we have. -| | | ${value} = | Set Variable | ${result.forwarding_count} +| | | ${value} = | Set Variable | ${result.forwarded_count} | | | Run Keyword If | ${value} < 0 | Log | Negative count ignored! | WARN | | | Continue For Loop If | ${value} < 0 | | | ${value} = | Evaluate | ${value} / ${result.offered_duration} -- 2.16.6