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
stringThe identifier of the QuotaService instance managing this quota context.
quotaName
stringThe name of the quota that this quota metric partition refers to.
quotaContext
stringThe quota context that this quota metric partition refers to.
quotaMetricPartitionId
stringThe identifier of the quota metric partion that this sequence refers to.
metricLimit
intThe limit of the metric for the time window specified by
metricWindowSeconds
.metricWindowSeconds
intThe time window for the metric limit.
lockoutDurationSeconds
intThe duration of the lockout period when the metric limit is exceeded.
logger
ILoggerThe 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
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
DateTimeOffsetThe 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.