PhiAccrual.EstimatorSupervisor (phi_accrual v1.0.0)

View Source

DynamicSupervisor owning one PhiAccrual.Estimator per tracked node.

Estimator processes are restarted :transient — a crash inside an estimator restarts only that node's estimator, leaving other nodes' state intact. This supervisor is started from the top-level phi_accrual application supervisor and is intentionally kept separate from the source-adapter supervisor so that restarting a source (e.g., PhiAccrual.Source.DistributionPing) does not wipe estimator state.

Summary

Functions

Returns a specification to start this module under a supervisor.

Start tracking node. Returns the existing pid if already tracked.

List every node currently tracked by an estimator.

Stop tracking node. No-op if the node is not tracked.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

track(node, core_opts \\ [])

@spec track(
  node(),
  keyword()
) :: {:ok, pid()} | {:error, term()}

Start tracking node. Returns the existing pid if already tracked.

tracked_nodes()

@spec tracked_nodes() :: [node()]

List every node currently tracked by an estimator.

untrack(node)

@spec untrack(node()) :: :ok

Stop tracking node. No-op if the node is not tracked.