Runtime resource monitoring per plugin.
Tracks actual resource usage against declared budgets from plugin manifests. Runs on a configurable timer (default 5s) and takes action when plugins exceed their budgets.
Actions (configurable per plugin):
:warn-- log warning + emit telemetry event:throttle-- reduce event delivery rate to plugin:kill-- unload the plugin via PluginLifecycle
Summary
Functions
Checks resource usage for a specific plugin against its budget.
Returns a specification to start this module under a supervisor.
Checks all monitored plugins and returns their status.
Sets the enforcement action for a plugin.
Returns whether a plugin is currently throttled.
Types
@type action() :: :warn | :throttle | :kill
@type budget() :: %{ max_memory_mb: number(), max_cpu_percent: number(), max_ets_tables: non_neg_integer(), max_processes: non_neg_integer() }
@type usage() :: %{ memory_mb: number(), cpu_percent: number(), ets_tables: non_neg_integer(), processes: non_neg_integer() }
Functions
Checks resource usage for a specific plugin against its budget.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec monitor_all() :: [{atom(), :ok | :over_budget}]
Checks all monitored plugins and returns their status.
Sets the enforcement action for a plugin.
Returns whether a plugin is currently throttled.