ObserverWeb.Tracer.Tool.Count (Observer Web v0.2.8)

View Source

Tallies :call events.

Ported and adapted from https://github.com/gabiz/tracer's Tracer.Tool.Count. Upstream groups counts by the values bound in a match spec's message(...) action via its own expression-based match DSL (each bound variable becomes a [name, value] pair). Observer Web doesn't bring that DSL over - the existing return_trace/exception_trace/caller/process_dump match specs each produce a single raw term instead (e.g. caller()'s calling pid), so there's no [name, value] list to unpack. Counts are grouped by the reporting node, the traced {mod, fun, arity}, and that raw message value - a call to the same function on two different nodes is tallied separately, matching how Live Tracing identifies which node ("service") each event came from.

Summary

Types

t()

@type t() :: %ObserverWeb.Tracer.Tool.Count{
  counts: %{optional(tuple()) => non_neg_integer()}
}

Functions

handle_event(state, arg2)

@spec handle_event(
  t(),
  struct()
) :: t()

handle_stop(count)

@spec handle_stop(t()) :: [{tuple(), non_neg_integer()}]

new()

@spec new() :: t()