instrument_tracer_pool (instrument v1.0.0)

View Source

Supervisor for flight tracer worker pool.

This module manages a pool of flight tracer workers. The pool size defaults to the number of schedulers for optimal parallelism. Workers are started on-demand when tracing is enabled.

The pool maintains a map of worker indices to pids that is used by the tracer NIF to distribute events via hash-based assignment.

Summary

Functions

Gets the tracer state map for erlang:trace. Returns a map with pool_size, workers, and label.

Returns the configured pool size.

Starts the pool supervisor.

Starts all workers in the pool. Idempotent - does nothing if pool is already running.

Stops all workers in the pool.

Functions

get_tracer_state(Label)

-spec get_tracer_state(integer()) -> map().

Gets the tracer state map for erlang:trace. Returns a map with pool_size, workers, and label.

init(_)

pool_size()

-spec pool_size() -> pos_integer().

Returns the configured pool size.

start_link()

-spec start_link() -> {ok, pid()} | ignore | {error, term()}.

Starts the pool supervisor.

start_pool()

-spec start_pool() -> ok.

Starts all workers in the pool. Idempotent - does nothing if pool is already running.

stop_pool()

-spec stop_pool() -> ok.

Stops all workers in the pool.