fix(MLR): Improve name of success counter 02/43002/1
authorVratko Polak <[email protected]>
Thu, 22 May 2025 08:37:28 +0000 (10:37 +0200)
committerVratko Polak <[email protected]>
Thu, 22 May 2025 08:37:28 +0000 (10:37 +0200)
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 <[email protected]>
PyPI/MLRsearch/README.rst
resources/libraries/python/MLRsearch/discrete_result.py
resources/libraries/python/MLRsearch/trial_measurement/measurement_result.py
resources/libraries/python/TrafficGenerator.py
resources/libraries/robot/performance/performance_utils.robot

index bec1b77..b44ca28 100644 (file)
@@ -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(_):
index 882b608..2c3ff81 100644 (file)
@@ -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,
index 9dc1ccf..8e0b104 100644 (file)
@@ -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:
index 3e0d854..60257ff 100644 (file)
@@ -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}")
index 12d9488..4be33e7 100644 (file)
 | | | ... | 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}