Unless the generate_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.
v3:
Rename of get_ping_evaluators() to generate_ping_evaluators(). The method
now takes also instance of PingEndpoints class.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/BaseEnrtRecipe.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py
index b69ed1f4..f8e6a57a 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
@@ -134,6 +135,10 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate,
PerfRecipe):
size = self.params.ping_psize,
)
+ ping_evaluators = self.generate_ping_evaluators(
+ pconf, endpoints)
+ pconf.register_evaluators(ping_evaluators)
+
ping_conf_list.append(pconf)
if self.params.ping_bidirect:
@@ -147,6 +152,9 @@ class BaseEnrtRecipe(BaseSubConfigMixin, PingTestAndEvaluate,
PerfRecipe):
def generate_ping_endpoints(self, config):
return []
+ def generate_ping_evaluators(self, pconf, endpoints):
+ return [RatePingEvaluator(min_rate=50)]
+
def generate_perf_configurations(self, config):
for flows in self.generate_flow_combinations(config):
perf_recipe_conf=dict(
--
2.21.1