Insider.Collector.Poller (Insider v0.1.0)

Copy Markdown View Source

Periodically records bounded scalar VM and explicitly targeted process samples.

By default the poller never enumerates processes and never requests messages, dictionaries, links, monitors, stack traces, or other private process state. Configured with top_processes or top_ets_tables, each cycle also scans every local process or ETS table once for bounded rankings (process_top, ets_top), reading only scalar counters, the group leader, and, for ranked processes, the registered name, current function, and the $initial_call dictionary key. Protected targets are never read; Insider's own processes and tables are summed apart from the rankings and reported next to the VM totals. With top_ports, each cycle also counts every local port by type and owner (port_top), reading only each port's name, connected process, and OS pid, with each type's growth since the previous census; ports of Insider's own processes are counted apart. watch_names samples the processes registered under those names each cycle (process_watch). Probe work runs in one monitored worker at a time. A timeout bounds how long the poller waits; it cannot roll back a process_info/2 request already delivered to the target, so timeout events disclose that uncertainty.

Summary

Functions

Returns a specification to start this module under a supervisor.

Permanently stops periodic polling and waits, within deadline, for the current probe to reach an accounting boundary.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

quiesce(server, deadline, timeout)

@spec quiesce(GenServer.server(), integer(), timeout()) ::
  {:ok, map()}
  | {:error, :quiescence_in_progress | :request_expired | :unavailable}

Permanently stops periodic polling and waits, within deadline, for the current probe to reach an accounting boundary.

A successful reply is a barrier: the returned status includes every event this poller can still offer to its recorder, and this poller will never start another probe. A deadline failure makes no quiescence claim, but still cancels future polling and quarantines the current worker.

start_link(arg1)

@spec start_link({Insider.Recorder.Handle.t(), keyword()}) :: GenServer.on_start()

start_link(recorder, options)

status(server)

@spec status(GenServer.server()) :: {:ok, map()} | {:error, :unavailable}