ides (ides v0.1.0)

View Source

Beware the Ides of March — find the supervisors and siblings that could kill your Erlang process.

Given any PID, this module shows:

  • Ancestors: the chain of supervisors above the process
  • Siblings: all children of the same supervisor
  • Kill graph: every process that could cause this PID to be killed
  • Restart logic: whether a terminated child will be restarted
  • Affected siblings: which siblings a supervisor would kill/restart if this PID dies

Uses OTP primitives: erlang:process_info/2 for $ancestors, supervisor:which_children/1, and proc_lib:translate_initial_call/1

Summary

Types

child_process()

-type child_process() :: ides_family:child_process().

child_restart_type()

-type child_restart_type() :: ides_family:child_restart_type().

exit_reason()

-type exit_reason() :: ides_march:exit_reason().

process()

-type process() :: ides_family:process().

supervisor_process()

-type supervisor_process() :: ides_family:supervisor_process().

supervisor_strategy()

-type supervisor_strategy() :: ides_family:supervisor_strategy().

Functions

affected_siblings(TargetPid)

-spec affected_siblings(TargetPid :: pid()) -> {ok, [pid()]} | {error, term()}.

ancestors(TargetPid)

-spec ancestors(TargetPid :: pid()) -> {ok, process()} | {error, term()}.

format(TargetPid, Tree)

-spec format(TargetPid :: pid(), Tree :: process()) -> iolist().

kill_graph(TargetPid)

-spec kill_graph(TargetPid :: pid()) -> {ok, [pid()]} | {error, term()}.

print(TargetPid, Tree)

-spec print(TargetPid :: pid(), Tree :: process()) -> ok.

should_restart(Pid, Reason)

-spec should_restart(Pid :: pid(), Reason :: exit_reason()) -> boolean().