The last failed publish of every sink under wal: :none, for
Ankusa.Health.Check.Sinks.
The direct ack path (Ankusa.Edge.Publish) has no queue and no retry, so a
broker that refuses every publish shows nowhere but in the 503s. It calls
record/3 with each sink's outcome: a failure stores the monotonic time under
the sink's identity (its module and options, hashed), a success removes the
entry, so a sink that came back reads healthy at once instead of after the
window. Both are one ETS write in the request process, no message to a
singleton.
One process per instance owns the table and sweeps entries older than
listener.ready_sink_error_window_ms every window, so the table holds at most the
sinks that failed within it. It is also capped at @max_entries: a failure of
a sink beyond the cap is not recorded (a node with that many failing sinks is
unready already, and the sweep makes room as they age out).
Summary
Functions
Returns a specification to start this module under a supervisor.
How many sinks failed their last publish within window_ms.
Note that the sink {mod, opts} just published with outcome (:ok or
:error). :ok when no tracker runs (an instance that is not wal: :none).
The table of one instance (the instance name is operator config, never request input).
Functions
@spec child_spec(keyword()) :: Supervisor.child_spec()
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec failing(atom(), pos_integer()) :: non_neg_integer()
How many sinks failed their last publish within window_ms.
Note that the sink {mod, opts} just published with outcome (:ok or
:error). :ok when no tracker runs (an instance that is not wal: :none).
@spec start_link(keyword()) :: GenServer.on_start()
The table of one instance (the instance name is operator config, never request input).