View Source Zexbox.Metrics.ContextRegistry (Zexbox v1.5.1)

GenServer that maintains an ETS set of PIDs for which metrics are disabled. Monitors registered PIDs and removes them on :DOWN to prevent leaks.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns true if the given pid is in the disabled set.

Registers the given pid as disabled for metrics. The pid is monitored so the entry is removed when the process exits.

Removes the given pid from the disabled set.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disabled?(pid)

@spec disabled?(pid() | atom() | nil) :: boolean()

Returns true if the given pid is in the disabled set.

register(pid)

@spec register(pid()) :: :ok

Registers the given pid as disabled for metrics. The pid is monitored so the entry is removed when the process exits.

start_link(opts \\ [])

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

unregister(pid)

@spec unregister(pid()) :: :ok

Removes the given pid from the disabled set.