Table of Contents

Interface ITimeoutMonitor

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Monitors timeout events and provides timeout statistics for adaptive timeout calculations. Timeout monitoring and adaptive timeout management.

public interface ITimeoutMonitor
Extension Methods

Methods

ClearStatistics(TimeoutOperationType?)

Clears timeout statistics for a specific operation type or all operations.

void ClearStatistics(TimeoutOperationType? operationType = null)

Parameters

operationType TimeoutOperationType?

The operation type to clear statistics for, or null for all operations.

CompleteOperation(ITimeoutOperationToken, bool, bool)

Records the completion of an operation.

void CompleteOperation(ITimeoutOperationToken token, bool success, bool timedOut)

Parameters

token ITimeoutOperationToken

The monitoring token from StartOperation.

success bool

Whether the operation completed successfully.

timedOut bool

Whether the operation timed out.

GetRecommendedTimeout(TimeoutOperationType, int, TimeoutContext?)

Gets the recommended timeout for an operation based on historical data.

TimeSpan GetRecommendedTimeout(TimeoutOperationType operationType, int percentile = 95, TimeoutContext? context = null)

Parameters

operationType TimeoutOperationType

The operation type to get a recommendation for.

percentile int

The percentile to use for the recommendation (e.g., 95 for 95th percentile).

context TimeoutContext

Additional context for the recommendation.

Returns

TimeSpan

The recommended timeout duration.

GetSampleCount(TimeoutOperationType)

Gets the number of samples collected for an operation type.

int GetSampleCount(TimeoutOperationType operationType)

Parameters

operationType TimeoutOperationType

The operation type to get sample count for.

Returns

int

The number of samples collected.

GetStatistics(TimeoutOperationType)

Gets timeout statistics for a specific operation type.

TimeoutStatistics GetStatistics(TimeoutOperationType operationType)

Parameters

operationType TimeoutOperationType

The operation type to get statistics for.

Returns

TimeoutStatistics

Timeout statistics for the operation type.

HasSufficientSamples(TimeoutOperationType, int)

Determines if enough samples have been collected for reliable adaptive timeout calculations.

bool HasSufficientSamples(TimeoutOperationType operationType, int minimumSamples = 100)

Parameters

operationType TimeoutOperationType

The operation type to check.

minimumSamples int

The minimum number of samples required.

Returns

bool

True if enough samples have been collected; otherwise, false.

StartOperation(TimeoutOperationType, TimeoutContext?)

Records the start of an operation for timeout monitoring.

ITimeoutOperationToken StartOperation(TimeoutOperationType operationType, TimeoutContext? context = null)

Parameters

operationType TimeoutOperationType

The type of operation being monitored.

context TimeoutContext

Additional context for the operation.

Returns

ITimeoutOperationToken

A monitoring token to track the operation.