BeamConsole.Runtime.Supervision (beam_console v0.5.2)

Copy Markdown View Source

Traverses local OTP supervision trees under explicit depth, child, and time limits.

The traversal is a pure state transition around one isolated runtime call: Supervisor.which_children/1. Unresponsive branches become partial results without blocking the shared collector.

Summary

Functions

Collects normalized supervision edges and process-to-application attribution.

Types

context()

@type context() :: %{
  local_node: node(),
  options: keyword(),
  sequence: non_neg_integer(),
  task_supervisor: GenServer.server(),
  task_supervisor_pid: pid() | nil,
  supervisor_limit: non_neg_integer(),
  children_limit: non_neg_integer(),
  depth_limit: non_neg_integer()
}

queue_item()

@type queue_item() ::
  {application :: atom(), supervisor :: pid(), depth :: non_neg_integer()}

result()

@type result() ::
  {edges :: %{required(String.t()) => BeamConsole.SupervisionEdge.t()},
   attribution :: %{required(String.t()) => atom()},
   observations :: [BeamConsole.Lifecycle.Observation.t()],
   partial_supervisors :: non_neg_integer(),
   traversal_limit_reached? :: boolean()}

root()

@type root() :: {application :: atom(), supervisor :: pid()}

Functions

collect(roots, local_node, options)

@spec collect([root()], node(), keyword()) :: result()

Collects normalized supervision edges and process-to-application attribution.

Branches that time out or exit increment the partial count. Reaching a depth, supervisor, or child limit sets the final boolean without discarding the bounded data collected so far.