BeamConsole.Recording.Control (beam_console v0.4.0)

Copy Markdown View Source

Owns restart-safe operator recording intent for the BeamConsole application.

The process stores only a boolean pause state and a monotonic revision. The collector and lifecycle recorder register as monitored consumers, receive the current state during initialization, and receive later transitions as bounded scalar messages. A child restart therefore converges without coupling the two runtime services to each other.

Summary

Functions

Returns a specification to start this module under a supervisor.

Pauses lifecycle recording and opt-in zero-viewer background sampling.

Registers the calling runtime service and returns the current control state.

Resumes lifecycle recording according to the configured demand mode.

Starts the recording control authority.

Returns the authoritative operator recording control state.

Subscribes the calling process to authoritative recording-state transitions.

Types

consumer()

@type consumer() :: %{pid: pid(), monitor_ref: reference()}

role()

@type role() :: :collector | :recorder

t()

@type t() :: %BeamConsole.Recording.Control{
  consumers: %{optional(role()) => consumer()},
  status: BeamConsole.Recording.Status.t(),
  subscribers: %{optional(pid()) => reference()}
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

pause(server \\ __MODULE__, timeout \\ 5000)

Pauses lifecycle recording and opt-in zero-viewer background sampling.

register(role, server \\ __MODULE__)

Registers the calling runtime service and returns the current control state.

resume(server \\ __MODULE__, timeout \\ 5000)

Resumes lifecycle recording according to the configured demand mode.

start_link(options \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the recording control authority.

status(server \\ __MODULE__, timeout \\ 5000)

Returns the authoritative operator recording control state.

subscribe(server \\ __MODULE__, timeout \\ 5000)

Subscribes the calling process to authoritative recording-state transitions.