BeamConsole.Lifecycle.Recorder (beam_console v0.3.0)

Copy Markdown View Source

Monitors a bounded set of local supervised processes and records safe exits.

Recording is lazy by default: the first console subscriber activates watches and the last subscriber removes them. In :always mode the recorder remains active for the application lifetime. Snapshot observations are consumed from the collector's existing supervision traversal; this process never calls a supervisor or retains a runtime snapshot. Reconciliation refreshes cross the runtime boundary through an injected, bounded requester.

Summary

Functions

Activates lazy recording when the first console subscriber connects.

Returns a specification to start this module under a supervisor.

Deactivates lazy recording and removes its process monitors.

Returns a newest-first bounded lifecycle-event window with omission metadata.

Reconciles one bounded private observation batch from a completed collector frame.

Pauses recording until an operator explicitly resumes it.

Resumes recording when subscriber or always-on demand is present.

Returns newest aggregate recorder frames under the configured history cap.

Starts a lifecycle recorder with optional configuration and runtime collaborators.

Returns PID-free recorder activity, coverage, and bounded-history statistics.

Types

query_error()

@type query_error() :: {:error, {:invalid_query_options, term()}}

status()

@type status() :: BeamConsole.Recorder.Status.t()

Functions

activate(server \\ __MODULE__)

@spec activate(GenServer.server()) :: :ok

Activates lazy recording when the first console subscriber connects.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

deactivate(server \\ __MODULE__)

@spec deactivate(GenServer.server()) :: :ok

Deactivates lazy recording and removes its process monitors.

events(options \\ [], server \\ __MODULE__, timeout \\ 5000)

Returns a newest-first bounded lifecycle-event window with omission metadata.

observe(frame, observations, options \\ [], server \\ __MODULE__)

Reconciles one bounded private observation batch from a completed collector frame.

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

Pauses recording until an operator explicitly resumes it.

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

Resumes recording when subscriber or always-on demand is present.

samples(options \\ [], server \\ __MODULE__, timeout \\ 5000)

Returns newest aggregate recorder frames under the configured history cap.

start_link(options \\ [])

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

Starts a lifecycle recorder with optional configuration and runtime collaborators.

The optional zero-arity :refresh_requester runs outside the recorder process and is bounded by :refresh_timeout, which defaults to 250 milliseconds. The existing :collector option remains supported with its original asynchronous refresh protocol.

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

@spec status(GenServer.server(), timeout()) :: status()

Returns PID-free recorder activity, coverage, and bounded-history statistics.