Skip to content
Tracon

QuotaThresholdCrossing

Namespace Tracon · Assembly Tracon.Abstractions.dll

A single quota threshold crossed by a period’s consumption.

public sealed record QuotaThresholdCrossing : IEquatable<QuotaThresholdCrossing>

objectQuotaThresholdCrossing

IEquatable<QuotaThresholdCrossing>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Returned by QuotaEnforcer.RecordAsync for every threshold that a completed root run’s consumption newly crossed — “newly” meaning the durable per-period dedup (IQuotaStore) claimed it for the first time; a threshold already claimed by an earlier run or a concurrent worker is not returned again.

A single completion can cross more than one threshold at once (for example both the 80% and the 100% mark of the same metric, or the QuotaMetric.Tokens and QuotaMetric.Cost metrics of the same rule) — each crossing is reported separately, one notice per metric/threshold pair.

public QuotaThresholdCrossing()

The agent the rule is bound to. null for a tenant-wide rule.

public string? AgentName { get; init; }

string?

The rule’s defined limit.

public required decimal Limit { get; init; }

decimal

The metric whose threshold was crossed.

public required QuotaMetric Metric { get; init; }

QuotaMetric

The dedup/delivery identifier for this crossing. Stable for the lifetime of the notice: a client that reads it again (through Last-Event-ID resumption or GET /api/runs/{id}/events) sees the same value and can suppress a duplicate warning.

public required string NoticeId { get; init; }

string

The counter’s interval.

public required QuotaPeriod Period { get; init; }

QuotaPeriod

The time the counter resets (UTC).

public DateTimeOffset? ResetsAt { get; init; }

DateTimeOffset?

The crossed threshold percentage (for example 80 or 100).

public required int ThresholdPercent { get; init; }

int

The consumption at the moment the threshold was claimed.

public required decimal Used { get; init; }

decimal

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(QuotaThresholdCrossing? other)

other QuotaThresholdCrossing?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(QuotaThresholdCrossing?, QuotaThresholdCrossing?)

Section titled “ operator ==(QuotaThresholdCrossing?, QuotaThresholdCrossing?)”
public static bool operator ==(QuotaThresholdCrossing? left, QuotaThresholdCrossing? right)

left QuotaThresholdCrossing?

right QuotaThresholdCrossing?

bool

operator !=(QuotaThresholdCrossing?, QuotaThresholdCrossing?)

Section titled “ operator !=(QuotaThresholdCrossing?, QuotaThresholdCrossing?)”
public static bool operator !=(QuotaThresholdCrossing? left, QuotaThresholdCrossing? right)

left QuotaThresholdCrossing?

right QuotaThresholdCrossing?

bool