ObserverWeb.Apps.Aggregator (Observer Web v0.2.7)
View SourceAggregates an application's supervision tree (as built by ObserverWeb.Apps.info/2) into
per-application totals - the observer_cli App pane's view: how many processes/ports an
application holds and how much memory, reductions and message-queue backlog they account for.
Counting walks the already-fetched tree, so it costs no RPCs. Summing process stats does one
Rpc.pinfo/2 per process (location transparent, so remote applications work), which is why it
is a separate, on-demand step - and why it's capped: trees with more processes than the cap
report a partial sum, flagged as such, instead of hammering the observed node.
Summary
Functions
Counts the tree's processes, ports and references. Pure tree walk, no RPCs.
Sums memory, reductions and message-queue length over the tree's processes (one Rpc.pinfo/2
per process, capped at 2000 - see the moduledoc). Processes that died since the tree
was built are skipped.
Types
@type counts() :: %{ processes: non_neg_integer(), ports: non_neg_integer(), references: non_neg_integer() }
@type stats() :: %{ memory: non_neg_integer(), reductions: non_neg_integer(), message_queue_len: non_neg_integer(), sampled: non_neg_integer(), partial?: boolean() }
Functions
@spec count(ObserverWeb.Apps.t() | map()) :: counts()
Counts the tree's processes, ports and references. Pure tree walk, no RPCs.
@spec stats(ObserverWeb.Apps.t() | map()) :: stats()
Sums memory, reductions and message-queue length over the tree's processes (one Rpc.pinfo/2
per process, capped at 2000 - see the moduledoc). Processes that died since the tree
was built are skipped.