Table of Contents

Class QuotaMetricPartition

Namespace
FoundationaLLM.Common.Services.Quota
Assembly
FoundationaLLM.Common.dll

Represents a partition of a quota metric.

public class QuotaMetricPartition
Inheritance
QuotaMetricPartition
Inherited Members
Extension Methods

Constructors

QuotaMetricPartition(string, string, string, string, int, int, int, ILogger)

Represents a partition of a quota metric.

public QuotaMetricPartition(string quotaServiceIdentifier, string quotaName, string quotaContext, string quotaMetricPartitionId, int metricLimit, int metricWindowSeconds, int lockoutDurationSeconds, ILogger logger)

Parameters

quotaServiceIdentifier string

The identifier of the QuotaService instance managing this quota context.

quotaName string

The name of the quota that this quota metric partition refers to.

quotaContext string

The quota context that this quota metric partition refers to.

quotaMetricPartitionId string

The identifier of the quota metric partion that this sequence refers to.

metricLimit int

The limit of the metric for the time window specified by metricWindowSeconds.

metricWindowSeconds int

The time window for the metric limit.

lockoutDurationSeconds int

The duration of the lockout period when the metric limit is exceeded.

logger ILogger

The logger instance to use for logging.

Properties

QuotaMetricPartitionId

The identifier of the quota metric partition that this sequence refers to.

public string QuotaMetricPartitionId { get; }

Property Value

string

Remarks

The value of the identifier is only relevant within the parent quota context (where it is unique).

Methods

AddLocalMetricUnit(DateTimeOffset)

Adds a local metric unit to the metric partition.

public QuotaMetricPartitionState AddLocalMetricUnit(DateTimeOffset localReferenceTime)

Parameters

localReferenceTime DateTimeOffset

The time at which the local metric unit was recorded.

Returns

QuotaMetricPartitionState

A QuotaMetricPartitionState instance with the current state of the metric partition.

AddRemoteMetricUnits(List<DateTimeOffset>)

Adds remote metric units to the metric partition.

public QuotaMetricPartitionState? AddRemoteMetricUnits(List<DateTimeOffset> remoteReferenceTimes)

Parameters

remoteReferenceTimes List<DateTimeOffset>

The times at which the remote metric units were recorded.

Returns

QuotaMetricPartitionState

A QuotaMetricPartitionState instance with the current state of the metric partition.