BudgetEvent
Something the budget did, delivered to a BudgetObserver and logged. Every event describes itself, so an observer need not rely on order.
Experimental (subclass). Subclassing needs @OptIn(ExperimentalForInheritanceWebToolsApi::class); reading and matching an event are Stable Core, and the seven leaves are final. The set grows in feature releases: match the leaves you care about and keep an else. No leaf prints a header value, a body, a credential or a store exception's message. Equality is identity.
Inheritors
Types
A hard window is full for its current period; it refuses until resetsAtEpochMillis. Raised once per window and period.
The budget is paused until untilEpochMillis, length from now, because of the hint source (PauseSource.RetryAfter, PauseSource.ResetIn, PauseSource.Boundary, or PauseSource.Snapshot for a restored pause). Emitted when a pause begins or is extended, never when a hint is shorter than the pause in force.
A server reading raised the local count of window to serverUsed, by raisedBy (at least 1).
A call was refused (or a waiter failed after a re-plan): wait is what it would have waited, Duration.INFINITE for CostExceedsLimit.
The restore ran: windowsRestored snapshot windows were merged, windowsDropped were stale or unknown, and ignoredForSkew says the snapshot was stamped further ahead than maxRestoreSkew (its stamp and pause ignored, its counts kept).
A store call failed: operation is StoreOperation.Load or StoreOperation.Save; cause is for diagnostics (the log prints its class name only).