ides_static (ides v0.4.0)

View Source

Summary

Functions

Return the ancestor supervisor chain for a module, from root to direct parent.

Look up a module by its registered process name in the tree.

Render the supervision tree as indented ASCII, marking the target with *.

Return restart intensity policy for a supervisor module.

Return all modules that could cause the target module's process to be killed.

Like format/2 but writes to stdout.

Return sibling modules (other children of the same parent supervisor).

Build the static supervision tree from BEAM files.Returns tree roots and any warnings (unresolvable modules, dynamic children).

Types

intensity_info()

-type intensity_info() :: #{max_restarts := non_neg_integer(), max_period := non_neg_integer()}.

kill_source()

-type kill_source() :: {ancestor, module()} | {sibling, module()}.

static_error()

-type static_error() ::
          {missing_beam, module()} |
          {no_debug_info, module()} |
          {not_a_supervisor, module()} |
          {dynamic_child_spec, module()} |
          {unresolvable_module, module()}.

static_process()

-type static_process() :: supervisor_process() | worker_process().

static_warning()

-type static_warning() ::
          {unresolvable_module, module()} |
          {dynamic_child_spec, module()} |
          {missing_behaviour, module()}.

supervisor_process()

-type supervisor_process() ::
          #{name := string(),
            module := module(),
            parent := module() | undefined,
            type := supervisor,
            strategy := ides:supervisor_strategy(),
            restart_type => ides:child_restart_type(),
            children := [static_process()],
            intensity := intensity_info()}.

t()

-type t() :: #{tree := [static_process()], warnings := [static_warning()]}.

worker_process()

-type worker_process() ::
          #{name := string(),
            module := module(),
            parent := module() | undefined,
            type := worker,
            restart_type := ides:child_restart_type()}.

Functions

ancestors/2

-spec ancestors(module(), t()) -> {ok, [module()]} | {error, not_found}.

Return the ancestor supervisor chain for a module, from root to direct parent.

find_process_by_name/2

-spec find_process_by_name(string(), t()) -> {ok, module()} | {error, not_found}.

Look up a module by its registered process name in the tree.

format/2

-spec format(module(), t()) -> iolist().

Render the supervision tree as indented ASCII, marking the target with *.

intensity_info/2

-spec intensity_info(module(), t()) -> {ok, intensity_info()} | {error, not_found}.

Return restart intensity policy for a supervisor module.

kill_graph/2

-spec kill_graph(module(), t()) -> {ok, [module()]} | {error, not_found}.

Return all modules that could cause the target module's process to be killed.

print(Module, Trees)

-spec print(module(), t()) -> ok.

Like format/2 but writes to stdout.

siblings/2

-spec siblings(module(), t()) -> {ok, [module()]} | {error, not_found}.

Return sibling modules (other children of the same parent supervisor).

supervisor_tree(BeamPaths)

-spec supervisor_tree([file:filename()]) ->
                         {ok, #{tree := [static_process()], warnings := [static_warning()]}} |
                         {error, static_error()}.

Build the static supervision tree from BEAM files.Returns tree roots and any warnings (unresolvable modules, dynamic children).