Provider health state machine with temporary exclusion windows.
Summary
Types
@type health_status() :: %{ status: :healthy | :degraded | :unhealthy, failures: non_neg_integer(), last_error: term() | nil, excluded_until_ms: integer() | nil, excluded?: boolean() }
Per-provider health status.
@type provider_id() :: term()
Unique provider candidate identifier used by the router.
@type t() :: %ASM.Extensions.Routing.HealthTracker{ by_provider: %{required(provider_id()) => tracker_state()}, failure_cooldown_ms: pos_integer() }
Functions
@spec available_provider_ids(t(), integer()) :: [provider_id()]
@spec mark_failure(t(), provider_id(), term(), integer()) :: {:ok, t()} | {:error, ASM.Error.t()}
@spec mark_success(t(), provider_id(), integer()) :: {:ok, t()} | {:error, ASM.Error.t()}
@spec new( [provider_id()], keyword() ) :: {:ok, t()} | {:error, ASM.Error.t()}
@spec snapshot(t(), integer()) :: %{required(provider_id()) => health_status()}
@spec status(t(), provider_id(), integer()) :: {:ok, health_status()} | {:error, ASM.Error.t()}