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
quotaServiceIdentifierstringThe identifier of the QuotaService instance managing this quota context.
quotaNamestringThe name of the quota that this quota metric partition refers to.
quotaContextstringThe quota context that this quota metric partition refers to.
quotaMetricPartitionIdstringThe identifier of the quota metric partion that this sequence refers to.
metricLimitintThe limit of the metric for the time window specified by
metricWindowSeconds.metricWindowSecondsintThe time window for the metric limit.
lockoutDurationSecondsintThe duration of the lockout period when the metric limit is exceeded.
loggerILoggerThe 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
localReferenceTimeDateTimeOffsetThe 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
remoteReferenceTimesList<DateTimeOffset>The times at which the remote metric units were recorded.
Returns
- QuotaMetricPartitionState
A QuotaMetricPartitionState instance with the current state of the metric partition.