Selecto.Performance.HookBehaviour behaviour (Selecto v0.3.8)
Behaviour for implementing custom performance monitoring hooks.
Modules implementing this behaviour can be used as hook providers for the Selecto performance monitoring system.
Link to this section Summary
Callbacks
Handle a hook point execution.
Initialize the hook provider.
Clean up resources when the hook provider is unregistered.
Link to this section Types
Link to this type
context()
@type context() :: map()
Link to this type
hook_fn()
Link to this type
hook_point()
@type hook_point() :: atom()
Link to this section Callbacks
Link to this callback
handle_hook(hook_point, context, state)
@callback handle_hook(hook_point(), context(), state :: term()) :: context()
Handle a hook point execution.
Receives the hook point name, current context, and provider state. Should return an updated context.
Link to this callback
init(opts)
Initialize the hook provider.
Called once when the hook provider is registered. Should return {:ok, state} or {:error, reason}.
Clean up resources when the hook provider is unregistered.