aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/scenarios/base.py')
-rw-r--r--yardstick/benchmark/scenarios/base.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/yardstick/benchmark/scenarios/base.py b/yardstick/benchmark/scenarios/base.py
index e1e31fd2a..8146067ba 100644
--- a/yardstick/benchmark/scenarios/base.py
+++ b/yardstick/benchmark/scenarios/base.py
@@ -28,6 +28,23 @@ class Scenario(object):
pass
@staticmethod
+ def get_types():
+ '''return a list of known runner type (class) names'''
+ scenarios = []
+ for scenario in utils.itersubclasses(Scenario):
+ scenarios.append(scenario)
+ return scenarios
+
+ @staticmethod
+ def get_cls(scenario_type):
+ '''return class of specified type'''
+ for scenario in utils.itersubclasses(Scenario):
+ if scenario_type == scenario.__scenario_type__:
+ return scenario
+
+ raise RuntimeError("No such scenario type %s" % scenario_type)
+
+ @staticmethod
def get(scenario_type):
"""Returns instance of a scenario runner for execution type.
"""