BudgetUtilisation

class BudgetUtilisation(windows: List<WindowUtilisation>, val pausedFor: Duration, val waiting: Int)(source)

A reading of the budget: each rate window's current period (windows, in declaration order), how long the budget is paused (pausedFor, zero for none) and how many calls wait (waiting).

Stable Core. Public constructor so an implementer of the port can build one. Equality is on the three properties; toString() prints them.

Parameters

windows

each window's current period, in declaration order.

pausedFor

how long the budget is paused; zero for none; not negative.

waiting

how many calls wait for a slot; not negative.

Throws

if pausedFor is negative or waiting is below 0.

Constructors

Link copied to clipboard
constructor(windows: List<WindowUtilisation>, pausedFor: Duration, waiting: Int)

Properties

Link copied to clipboard

How long the budget is paused; zero for none.

Link copied to clipboard

How many calls wait for a slot.

Link copied to clipboard

The windows in declaration order, a read-only copy.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two BudgetUtilisations are equal when their windows, pausedFor and waiting are equal.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: windows, pausedFor and waiting. Its format is not part of the API and may change.