Render-oriented tree node derived from flat SystemObserver snapshots.
SystemObserver keeps snapshots in a flat map keyed by PID because that is cheap to collect and easy to sample over time. The Observatory derives this tree when it needs hierarchy for rendering.
Summary
Functions
Builds a supervision tree from a flat %{pid => ProcessSnapshot.t()} map.
Returns the tree as a pre-order list of nodes.
Types
@type t() :: %Minga.SystemObserver.TreeNode{ children: [t()], depth: non_neg_integer(), pid: pid(), snapshot: Minga.SystemObserver.ProcessSnapshot.t() }
Functions
@spec build_tree(%{required(pid()) => Minga.SystemObserver.ProcessSnapshot.t()}) :: t() | nil
Builds a supervision tree from a flat %{pid => ProcessSnapshot.t()} map.
Returns nil when the snapshot has no root process. Children whose parent is missing from the map are ignored because they cannot be placed in the rendered tree safely.
Returns the tree as a pre-order list of nodes.