Skip to main content

IThrottleTracker

  • Namespace: PPDS.Dataverse.Resilience
  • Assembly: PPDS.Dataverse
  • Kind: Interface

Summary​

Tracks throttle state across connections. Used by the connection pool to route requests away from throttled connections.

Members​

Methods​

ClearThrottle​

void ClearThrottle(string connectionName)

Clears throttle state for a connection.

  • Param connectionName: The connection to clear.

GetShortestExpiry​

TimeSpan GetShortestExpiry()

Gets the shortest time until any throttled connection expires. Returns System.TimeSpan.Zero if no connections are throttled.

  • Returns: The shortest time until a throttle expires, or System.TimeSpan.Zero if none are throttled.

GetThrottleExpiry​

Nullable<DateTime> GetThrottleExpiry(string connectionName)

Gets when a connection's throttle expires.

  • Param connectionName: The connection to check.

  • Returns: The expiry time, or null if not throttled.

IsThrottled​

bool IsThrottled(string connectionName)

Checks if a connection is currently throttled.

  • Param connectionName: The connection to check.

  • Returns: True if the connection is throttled.

RecordThrottle​

void RecordThrottle(string connectionName, TimeSpan retryAfter)

Records a throttle event for a connection.

  • Param connectionName: The connection that was throttled.

  • Param retryAfter: How long to wait before retrying.

Properties​

ThrottledConnectionCount​

int ThrottledConnectionCount { get; }

Gets the number of currently throttled connections.

ThrottledConnections​

IReadOnlyCollection<string> ThrottledConnections { get; }

Gets the names of all currently throttled connections.

TotalBackoffTime​

TimeSpan TotalBackoffTime { get; }

Gets the total backoff time accumulated from all throttle events. This represents the sum of all RetryAfter durations, not actual time spent waiting.

TotalThrottleEvents​

long TotalThrottleEvents { get; }

Gets the total number of throttle events recorded.