Class RollingWindowHealthQueue
java.lang.Object
io.appform.ranger.core.healthservice.monitor.RollingWindowHealthQueue
This class may be used to keep track of health in a rolling window
Maintains a queue of
HealthcheckStatuss of size rollingWindowSize-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckInRollingWindow(HealthcheckStatus currentHealthStatus) dequeues the latest incoming status, enqueues the latest health status updates the failure counts accordingly
-
Constructor Details
-
RollingWindowHealthQueue
- Parameters:
rollingWindowSize- size of the rolling window to be maintainedmaxFailures- maximum failures allowed in the window
-
-
Method Details
-
checkInRollingWindow
dequeues the latest incoming status, enqueues the latest health status updates the failure counts accordingly- Parameters:
currentHealthStatus- current health status coming from outside- Returns:
trueif the current failures in the queue are less than the maxFailurefalseif the current failures in the queue are more than or equal to the maxFailures
-