Andrey Kurilin 44486ef65e [docs] Several improvements for extensions
* plugin_reference is extended to build data for particular Plugin Base cls
* plugin_reference is extended to build data for all Plugin Bases (instead
  of just building data for hardcoded classes).
* cli_reference is extended to build data for particular command
* new include_vars extension is introduced for including const data in docs

Change-Id: I76d9f85e41c6ab8e622f6d3581478962144525ba
2017-01-23 10:16:24 +00:00

2.6 KiB

Rally Plugins

Rally has a plugin oriented architecture - in other words Rally team is trying to make all places of code pluggable. Such architecture leads to the big amount of plugins. plugin-reference contains a full list of all official Rally plugins with detailed descriptions.

plugin_reference

How plugins work

Rally provides an opportunity to create and use a custom benchmark scenario, runner, SLA, deployment or context as a plugin:

image

Placement

Plugins can be quickly written and used, with no need to contribute them to the actual Rally code. Just place a Python module with your plugin class into the /opt/rally/plugins or ~/.rally/plugins directory (or its subdirectories), and it will be automatically loaded. Additional paths can be specified with the --plugin-paths argument, or with the RALLY_PLUGIN_PATHS environment variable, both of which accept comma-delimited lists. Both --plugin-paths and RALLY_PLUGIN_PATHS can list either plugin module files, or directories containing plugins. For instance, both of these are valid:

rally --plugin-paths /rally/plugins ...
rally --plugin-paths /rally/plugins/foo.py,/rally/plugins/bar.py ...

You can also use a script unpack_plugins_samples.sh from samples/plugins which will automatically create the ~/.rally/plugins directory.

How to create a plugin

To create your own plugin you need to inherit your plugin class from plugin.Plugin class or its subclasses. Also you need to decorate your class with rally.task.scenario.configure

from rally.task import scenario

@scenario.configure(name="my_new_plugin_name")
class MyNewPlugin(plugin.Plugin):
    pass

implementation/**