Observer.Web.Tracing.Selection (Observer Web v0.2.5)

View Source

Shared node/module/function selection state, used by both the Tracing page and the Profiling page - the two pages that let a user pick which functions to trace before running a session.

Summary

Functions

Builds the functions_by_node-shaped list ObserverWeb.Tracer.start_trace/2 expects, from the current selection. match_spec_keys is attached to every entry (the Tracing page passes the user-selected match specs; the Profiling page, which has no match-spec picker, passes []).

Empty selection state. Does not call out to any node, so it's safe to use before the socket is connected (the disconnected/dead render).

Rebuilds the selection state for the current cluster membership, given the currently selected keys. Only queries modules/functions for nodes/modules that are actually selected.

Types

t()

@type t() :: %{
  services_keys: [String.t()],
  modules_keys: [String.t()],
  functions_keys: [String.t()],
  selected_services_keys: [String.t()],
  selected_modules_keys: [String.t()],
  selected_functions_keys: [String.t()],
  node: list()
}

Functions

build_functions_to_monitor(node_info, match_spec_keys \\ [])

@spec build_functions_to_monitor(t(), [String.t()]) :: list()

Builds the functions_by_node-shaped list ObserverWeb.Tracer.start_trace/2 expects, from the current selection. match_spec_keys is attached to every entry (the Tracing page passes the user-selected match specs; the Profiling page, which has no match-spec picker, passes []).

new()

@spec new() :: t()

Empty selection state. Does not call out to any node, so it's safe to use before the socket is connected (the disconnected/dead render).

update(selected_services_keys, selected_modules_keys, selected_functions_keys)

@spec update([String.t()], [String.t()], [String.t()]) :: t()

Rebuilds the selection state for the current cluster membership, given the currently selected keys. Only queries modules/functions for nodes/modules that are actually selected.