WindowSnapshot

class WindowSnapshot(val window: String, val windowStartEpochMillis: Long, val used: Int)(source)

The count of one hard window in one period: used units charged in the period that started at windowStartEpochMillis (a multiple of the window's period since the epoch).

Stable Core. Equality is on the three properties; toString() prints the name and the numbers only.

Parameters

window

the window's name, as RateWindow.name spells it; not blank.

windowStartEpochMillis

the start of the period, in epoch milliseconds.

used

the units counted in the period, in cost units; not negative.

Throws

if window is blank or used is negative.

Constructors

Link copied to clipboard
constructor(window: String, windowStartEpochMillis: Long, used: Int)

Properties

Link copied to clipboard
val used: Int

The units counted in the period, in cost units; not negative.

Link copied to clipboard

The window's name, as RateWindow.name spells it; not blank.

Link copied to clipboard

The start of the period, in epoch milliseconds.

Functions

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

Two WindowSnapshots are equal when their window, windowStartEpochMillis and used 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: window, windowStartEpochMillis and used. Its format is not part of the API and may change.