Class Plugin
Defined in File plugin.hpp
Class Documentation
-
class Plugin
Public Functions
-
virtual ~Plugin() = default
-
virtual void register_pub_sub(PubSubRegistry&) = 0
Register the Plugin’s Publishers and Subscribers.
Each Plugin must implement this method. When the Plugin invokes pub_sub_registry.register_pub_sub(), it instructs the performance_test core how to construct a Publisher and Subscriber for the selected message type.
- Parameters:
pub_sub_registry –
-
inline virtual void register_custom_runners(RunnerRegistry&)
Register the Plugin’s custom Runners.
Most Plugins will not need to implement this method. The built-in Runners will be sufficient for most performance experiments. When the Plugin invokes runner_registry.register_runner(), it instructs the performance_test core how to construct additional Runners beyond the built-in Runners.
- Parameters:
runner_registry –
-
inline virtual void global_setup(const ExperimentConfiguration&)
Set up any global context or shared state necessary for the Pubs and Subs.
This method is called before creating the Runner, the Publishers, and the Subscribers. If there is any global setup to perform, or any shared state to initialize, then the Plugin should override this method and perform that setup here.
- Parameters:
ec –
-
inline virtual void global_teardown(const ExperimentConfiguration&)
Tear down any global context or shared state.
This method is called after the experiment is finished. If the Plugin needs to reset any global state, remove temporary files, etc., then the Plugin should override this method and perform that teardown here.
- Parameters:
ec –
-
inline virtual std::map<std::string, std::string> extra_log_info()
Provide Plugin-specific information for the logs.
When performance_test writes a log file, this extra information is added to the section of the log file that corresponds to the ExperimentConfiguration. A Plugin should override this if, for example, it is configured by environment variables beyond the scope of ExperimentConfiguration. Those environment variables could be included in the logs, so there is no question about the experiment’s full configuration.
- Returns:
Plugin-specific information to log.
-
inline virtual bool exit_requested()
Allow the Plugin to request that the experiment end early.
If a Plugin throws an unhandled exception, then it is unlikely that any data will be captured in the logs. This is fine for early detection of configuration errors, but not ideal if something goes wrong halfway through the experiment. This method allows the Plugin to request a clean exit when the Runner finishes its current loop.
- Returns:
Whether the Plugin has requested the experiment to exit.
-
virtual ~Plugin() = default