Skip to main content

VortexPlugin

Trait VortexPlugin 

Source
pub trait VortexPlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn check_fault(
        &self,
        ctx: &mut PluginContext<'_>,
        operation: &str,
    ) -> FaultCheck;

    // Provided methods
    fn on_register(&self) { ... }
    fn on_shutdown(&self) { ... }
}
Expand description

Trait for custom fault injection plugins.

Implement this to add custom fault types (e.g., gRPC errors, DNS failures, TLS handshake faults) that integrate with Vortex’s simulation layers.

Required Methods§

Source

fn name(&self) -> &str

Plugin name (used for logging and configuration).

Source

fn check_fault( &self, ctx: &mut PluginContext<'_>, operation: &str, ) -> FaultCheck

Check if a fault should be injected for the given operation.

Called by the simulation engine before each intercepted operation. The operation string describes what’s happening (e.g., “fs:write:/data.wal”, “net:connect:127.0.0.1:5432”, “grpc:call:UserService/GetUser”).

Provided Methods§

Source

fn on_register(&self)

Called once when the plugin is registered. Use for setup.

Source

fn on_shutdown(&self)

Called once when the simulation ends. Use for cleanup/reporting.

Implementors§