sequence = 1
- benchmark = cls(context)
- method = getattr(benchmark, method_name)
-
interval = context.get("interval", 1)
arg_name = context.get('name')
stop = context.get('stop')
LOG.info("worker START, step(%s, %d, %d, %d), class %s",
arg_name, start, stop, step, cls)
+ benchmark = cls(context)
+ benchmark.setup()
+ method = getattr(benchmark, method_name)
+
record_context = {"runner": context["runner"],
"host": context["host"]}
if errors:
break
+ benchmark.teardown()
LOG.info("worker END")
sequence = 1
- benchmark = cls(context)
- method = getattr(benchmark, method_name)
interval = context.get("interval", 1)
duration = context.get("duration", 60)
+ LOG.info("worker START, duration %d sec, class %s", duration, cls)
+
context['runner'] = os.getpid()
- LOG.info("worker START, duration %d sec, class %s", duration, cls)
+ benchmark = cls(context)
+ benchmark.setup()
+ method = getattr(benchmark, method_name)
record_context = {"runner": context["runner"],
"host": context["host"]}
if (errors and sla_action is None) or (time.time() - start > duration):
LOG.info("worker END")
- return
+ break
+
+ benchmark.teardown()
class DurationRunner(base.Runner):
class Scenario(object):
+ def setup(self):
+ ''' default impl for scenario setup '''
+ pass
+
def run(self, args):
+ ''' catcher for not implemented run methods in subclasses '''
+ raise RuntimeError("run method not implemented")
+
+ def teardown(self):
+ ''' default impl for scenario teardown '''
pass
@staticmethod