QuotaRule
A cap on how often a short rest is taken: “at most 3 reduced rests between two full rests”.
import type { QuotaRule } from "@northguild/gmt";Members
Section titled “Members”| Member | Type | Description |
|---|---|---|
label | string | The caller’s name for the rule. The report is keyed by it; labels must be unique. |
severity? | "violation" | "advisory" (DutySeverity) | Whether a failure is a violation or an advisory. |
kind | "quota" | Selects this rule kind. |
event | object | The run that counts once. |
event.statuses | S[] | The statuses the run is made of. |
event.minimum | string | The shortest run that counts, a positive ISO 8601 duration of exact time. |
event.maximum | string | The length a run must stay under to count, a positive ISO 8601 duration of exact time. |
count | number | The most events allowed, a non-negative integer. |
reset | Reset<S> | object (Reset, Period) | What starts the count again: a full rest, or a window. |
reset.every | Period | The window the events are counted in. |
Definition
Section titled “Definition”type QuotaRule<S extends string = string> = { /** The caller's name for the rule. The report is keyed by it; labels must be unique. */ label: string; /** * Whether a failure is a violation or an advisory. * * @defaultValue `"violation"`. */ severity?: DutySeverity; /** Selects this rule kind. */ kind: "quota"; /** The run that counts once. */ event: { /** The statuses the run is made of. */ statuses: S[]; /** The shortest run that counts, a positive ISO 8601 duration of exact time. */ minimum: string; /** The length a run must stay under to count, a positive ISO 8601 duration of exact time. */ maximum: string; }; /** The most events allowed, a non-negative integer. */ count: number; /** What starts the count again: a full rest, or a window. */ reset: | Reset<S> | { /** The window the events are counted in. */ every: Period; };};