Skip to content
Tracon

TraconQuotaOptions

Namespace Tracon · Assembly Tracon.Core.dll

Defines options for the quota subsystem.

public sealed class TraconQuotaOptions

objectTraconQuotaOptions

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

Read from the Tracon:Quotas configuration section.

public TraconQuotaOptions()

Gets the configuration section name.

public const string SectionName = "Tracon:Quotas"

string

Gets or sets whether to allow a run when quota enforcement fails.

public bool AllowOnStoreFailure { get; set; }

bool

Defaults to true so a temporary database outage does not stop the service. A strict deployment can set this to false and choose “do not run when quota cannot be verified”.

Gets or sets whether quota enforcement is enabled. When disabled, rules can be stored but no run is rejected and no counter increments.

public bool Enabled { get; set; }

bool

Defaulting to true is safe: nothing is rejected while no rule exists. The “no default quota” rule comes from an empty rule set, not from disabling the subsystem.

Gets or sets whether a crossed quota threshold is also written as a RunEventType.Custom notice (RunEventCustomTypes.QuotaThreshold) into the triggering root run’s own event stream, before its terminal event.

public bool PublishThresholdToRunStream { get; set; }

bool

Defaults to false: with it off, behavior is byte-for-byte identical to before this option existed — the same quota.threshold webhook, no new frame in the run’s event stream. The webhook itself is unaffected by this flag; it always fires when a threshold is crossed, exactly as before.

A consumer that wants a threshold notice correlated to the exact run and delivered on the same connection the run streamed from turns this on. See RunEventCustomTypes.QuotaThreshold for the event’s shape and the guarantee that only Tracon can write it.

Gets percentages that publish a quota.threshold event when the quota counter reaches them.

public IList<int> ThresholdPercents { get; }

IList<int>

Each threshold is published once per period. Otherwise, every run above the threshold would produce a new event as the counter increments.

Gets or sets the time zone used to calculate period boundaries. Windows and IANA names are accepted.

public string TimeZone { get; set; }

string

An administrator who says “daily quota” means their business day. The consumer is therefore expected to change the default UTC time zone.

Returns the resolved time zone, falling back to UTC when its name is unknown.

public TimeZoneInfo ResolveTimeZone()

TimeZoneInfo

The time zone.

An unrecognized name does not throw because quota enforcement must not stop all traffic for a bad name. TraconQuotaOptionsValidator validates it during startup and reports the error there.