FailureRateSlidingWindow

Represents a sliding window that can be used to monitor the failure rate of a system. Records results of operations (successes and failures) in a fixed-size window and calculates the failure rate.

Inheritors

Properties

Link copied to clipboard
abstract val capacity: Int

The fixed size of the window.

Functions

Link copied to clipboard
abstract fun clear()

Clears the window and any underlying state.

Link copied to clipboard
abstract fun currentFailureRate(): Double

Returns the current failure rate of the system.

Link copied to clipboard
abstract fun recordFailure()

Records a failed operation. The term "failed" depends on the implementation.

Link copied to clipboard
abstract fun recordSuccess()

Records a successful operation. The term "successful" depends on the implementation.