diff options
Diffstat (limited to 'yardstick/benchmark/runners/base.py')
-rw-r--r-- | yardstick/benchmark/runners/base.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py index 38ca34f4b..08117c625 100644 --- a/yardstick/benchmark/runners/base.py +++ b/yardstick/benchmark/runners/base.py @@ -41,13 +41,22 @@ class Runner(object): runners = [] @staticmethod - def _get_cls(runner_type): + def get_cls(runner_type): + '''return class of specified type''' for runner in utils.itersubclasses(Runner): if runner_type == runner.__execution_type__: return runner raise RuntimeError("No such runner_type %s" % runner_type) @staticmethod + def get_types(): + '''return a list of known runner type (class) names''' + types = [] + for runner in utils.itersubclasses(Runner): + types.append(runner) + return types + + @staticmethod def get(config): """Returns instance of a scenario runner for execution type. """ @@ -62,7 +71,7 @@ class Runner(object): args=(config["output_filename"], Runner.queue)) Runner.dump_process.start() - return Runner._get_cls(config["type"])(config, Runner.queue) + return Runner.get_cls(config["type"])(config, Runner.queue) @staticmethod def release(runner): |