On Tue, Mar 24, 2020 at 05:49:08PM +0100, Jan Tluka wrote:
Unless the get_ping_evaluators() method is overriden, the default
Ping
evaluator will be set to RatePingEvaluator with the minimum ping rate of 50%.
v2:
I moved the registration of default Ping evaluator to separate
class method because individual classes may need specific evaluators
for specific Ping configurations.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index d5d52bb9..84d192ee 100644
--- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py
+++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
@@ -14,6 +14,7 @@ from lnst.RecipeCommon.Perf.Measurements import Flow as PerfFlow
from lnst.RecipeCommon.Perf.Measurements import IperfFlowMeasurement
from lnst.RecipeCommon.Perf.Measurements import StatCPUMeasurement
from lnst.RecipeCommon.Perf.Evaluators import NonzeroFlowEvaluator
+from lnst.RecipeCommon.Ping.Evaluators import RatePingEvaluator
class EnrtConfiguration(object):
pass
@@ -133,6 +134,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate,
PerfRecipe):
size = self.params.ping_psize,
)
+ ping_evaluators = self.get_ping_evaluators(pconf)
+ pconf.register_evaluators(ping_evaluators)
+
ping_conf_list.append(pconf)
if self.params.ping_bidirect:
@@ -146,6 +150,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate,
PerfRecipe):
def generate_ping_endpoints(self, config):
return []
+ def get_ping_evaluators(self, pconf):
+ return [RatePingEvaluator(min_rate=50)]
+
This should jus tbe a property to be consistent with how perf evaluators
are defined:
@property
def ping_evaluators():
...
The registration can then look like this:
pconf.register_evaluators(self.ping_evaluators)
instead of being split into two parts of "get" and "register"
def generate_perf_configurations(self, config):
for flows in self.generate_flow_combinations(config):
perf_recipe_conf=dict(
--
2.21.1
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...