TermUI.Widgets.ProcessMonitor (TermUI v0.2.0)
View SourceProcessMonitor widget for live BEAM process inspection.
ProcessMonitor displays live process information including PID, name, reductions, memory, and message queue depth. It provides controls for process management and debugging.
Usage
ProcessMonitor.new(
update_interval: 1000,
show_system_processes: false
)Features
- Live process list with PID, name, reductions, memory
- Configurable update interval
- Message queue depth display with warnings
- Process links/monitors visualization
- Stack trace display
- Process actions (kill, suspend, resume)
- Sorting by any field
- Filtering by name/module
Keyboard Controls
- Up/Down: Move selection
- PageUp/PageDown: Scroll by page
- Enter: Toggle details panel
- r: Refresh now
- s: Cycle sort field
- S: Toggle sort direction
- /: Start filter input
- k: Kill selected process (with confirmation)
- p: Pause/resume selected process
- l: Show links/monitors
- t: Show stack trace
- Escape: Clear filter/close details
Summary
Functions
Get currently selected process.
Get stack trace for a process.
Creates new ProcessMonitor widget props.
Get process count.
Force refresh the process list.
Set filter pattern.
Set the update interval.
Set sorting options.
Types
@type process_info() :: %{ pid: pid(), registered_name: atom() | nil, initial_call: {module(), atom(), arity()} | nil, current_function: {module(), atom(), arity()} | nil, reductions: non_neg_integer(), memory: non_neg_integer(), message_queue_len: non_neg_integer(), status: atom(), links: [pid()], monitors: [term()], monitored_by: [pid()], stack_trace: [term()] | nil }
@type sort_direction() :: :asc | :desc
@type sort_field() :: :pid | :name | :reductions | :memory | :queue | :status
@type thresholds() :: %{ queue_warning: non_neg_integer(), queue_critical: non_neg_integer(), memory_warning: non_neg_integer(), memory_critical: non_neg_integer() }
Functions
@spec get_selected(map()) :: process_info() | nil
Get currently selected process.
Get stack trace for a process.
Creates new ProcessMonitor widget props.
Options
:update_interval- Refresh interval in ms (default: 1000):show_system_processes- Include system processes (default: false):thresholds- Warning thresholds map:on_select- Callback when process is selected:on_action- Callback when action is performed
@spec process_count(map()) :: non_neg_integer()
Get process count.
Force refresh the process list.
Set filter pattern.
@spec set_interval(map(), non_neg_integer()) :: {:ok, map()}
Set the update interval.
@spec set_sort(map(), sort_field(), sort_direction()) :: {:ok, map()}
Set sorting options.