Skip to content

Commit

Permalink
BaseEnrtRecipe: remove perf_evaluation_strategy parameter
Browse files Browse the repository at this point in the history
This parameter logically doesn't fit into the generic upstream
BaseEnrtRecipe class.

The reason for this is that from the upstream point of view it doesn't
actually do anything - it only recognized the "none" and "nonzero"
values which... are special use cases and the implementation was a bit
clunky.

We could refactor this to make it make a bit more sense in the upstream
and for it to be extensible - I think this should be an extensible Mixin
class that handles evaluator registration for enrt perf measurements...

But I think it doesn't have a valid use case in upstream yet so I'm
removing it for now. We may want to revisit this later.

Signed-off-by: Ondrej Lichtner <[email protected]>
  • Loading branch information
olichtne committed Dec 1, 2023
1 parent 92fc00b commit 1aae590
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions lnst/Recipes/ENRT/BaseEnrtRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ class BaseEnrtRecipe(
specify how many times should each performance measurement be repeated
to generate cumulative results which can be statistically analyzed.
:type perf_iterations: :any:`IntParam` (default 5)
:param perf_evaluation_strategy:
Parameter used by the :any:`evaluator_by_measurement` selector to
pick correct performance measurement evaluators based on the strategy
specified.
:type perf_evaluation_strategy: :any:`StrParam` (default "all")
"""

driver = StrParam()
Expand All @@ -187,7 +181,6 @@ class BaseEnrtRecipe(

# generic perf test params
perf_iterations = IntParam(default=5)
perf_evaluation_strategy = StrParam(default="all")

def test(self):
"""Main test loop shared by all the Enrt recipes
Expand Down Expand Up @@ -472,27 +465,14 @@ def evaluator_by_measurement(self, measurement):
The selector looks at the input measurement to pick
appropriate evaluator.
If :any: `perf_evaluation_strategy` property is set
to either "none" or "nonzero", selector returns
given evaluators based on their strategy.
:return: list of Result evaluators
:rtype: List[:any:`BaseResultEvaluator`]
"""
if self.params.perf_evaluation_strategy == "none":
return []

if isinstance(measurement, BaseCPUMeasurement):
if self.params.perf_evaluation_strategy in ["nonzero", "none"]:
evaluators = []
else:
evaluators = self.cpu_perf_evaluators
evaluators = self.cpu_perf_evaluators
elif isinstance(measurement, BaseFlowMeasurement):
if self.params.perf_evaluation_strategy == "nonzero":
evaluators = [NonzeroFlowEvaluator()]
else:
evaluators = self.net_perf_evaluators
evaluators = self.net_perf_evaluators
else:
evaluators = []

Expand Down

0 comments on commit 1aae590

Please sign in to comment.