WindowUtilisation
One window's current period. used is the count charged against the window this period, in cost units (a call of cost 3 adds 3), not calls: what was granted in this process, what was restored from the store, any rise a server reading forced (see BudgetEvent.Reconciled) and any count a backward wall-clock step copied into the period; queued is the count reserved for waiters; remaining = max(0, limit - used - queued); fraction = used / limit. A consumer that wants to stretch polling intervals needs the burn ratio, not the raw fraction: worked example — 40 of 50 at second 55 of a minute (fraction 0.8, elapsedFraction 0.92) is slack, 40 of 50 at second 10 (0.8 over 0.17) is not; fraction / elapsedFraction is the projected end-of-period usage, and the threshold is the consumer's policy.
Stable Core. Public constructor so an implementer of the port can build one. Equality is on every property; toString() prints them.
Parameters
the window's name; not blank.
the count charged against the window this period, in cost units; not negative.
the count reserved for waiters; not negative.
the enforced limit; at least 1.
the provider's documented limit; at least limit.
the start of the current period, in epoch milliseconds.
the end of the current period, in epoch milliseconds.
whether the window is hard.
how far the period has run, in [0, 1].
Throws
Constructors
Properties
Functions
Two WindowUtilisations are equal when their name, used, queued, limit, published, windowStartEpochMillis, resetsAtEpochMillis, hard and elapsedFraction are equal.
A diagnostic string for logs: name, used, queued, limit, published, windowStartEpochMillis, resetsAtEpochMillis, hard and elapsedFraction. Its format is not part of the API and may change.