Class HealthChecker
-
- All Implemented Interfaces:
-
java.lang.Runnable,org.jitsi.health.HealthCheckService,org.jitsi.utils.concurrent.RecurringRunnable
public final class HealthChecker extends PeriodicRunnable implements HealthCheckService
A HealthCheckService implementation which checks health via the provided healthCheckFunc function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classHealthChecker.Companion
-
Field Summary
Fields Modifier and Type Field Description private Durationintervalprivate final Resultresultprivate Durationtimeoutprivate DurationmaxCheckDurationprivate BooleanstickyFailuresprivate DurationstickyFailuresGracePeriodpublic final static HealthChecker.CompanionCompanion
-
Method Summary
Modifier and Type Method Description final DurationgetInterval()The interval at which health checks will be performed. final UnitsetInterval(Duration interval)The interval at which health checks will be performed. ResultgetResult()The result of a health check. final DurationgetTimeout()If no health checks have been performed in the last {@code timeout} period, the service is considered unhealthy. final UnitsetTimeout(Duration timeout)If no health checks have been performed in the last {@code timeout} period, the service is considered unhealthy. final DurationgetMaxCheckDuration()The maximum duration that a call to {@link #performCheck()} is allowed to take. final UnitsetMaxCheckDuration(Duration maxCheckDuration)The maximum duration that a call to {@link #performCheck()} is allowed to take. final BooleangetStickyFailures()If set, a single health check failure after the initial {@link #STICKY_FAILURES_GRACE_PERIOD} will be result in the service being permanently unhealthy. final UnitsetStickyFailures(Boolean stickyFailures)If set, a single health check failure after the initial {@link #STICKY_FAILURES_GRACE_PERIOD} will be result in the service being permanently unhealthy. final DurationgetStickyFailuresGracePeriod()Failures in this period (since the start of the service) are not sticky. final UnitsetStickyFailuresGracePeriod(Duration stickyFailuresGracePeriod)Failures in this period (since the start of the service) are not sticky. final Unitstart()final Unitstop()Unitrun()Performs a health check and updates this instance's state. -
-
Method Detail
-
getInterval
final Duration getInterval()
The interval at which health checks will be performed.
-
setInterval
final Unit setInterval(Duration interval)
The interval at which health checks will be performed.
-
getTimeout
final Duration getTimeout()
If no health checks have been performed in the last {@code timeout} period, the service is considered unhealthy.
-
setTimeout
final Unit setTimeout(Duration timeout)
If no health checks have been performed in the last {@code timeout} period, the service is considered unhealthy.
-
getMaxCheckDuration
final Duration getMaxCheckDuration()
The maximum duration that a call to {@link #performCheck()} is allowed to take. If a call takes longer, the service is considered unhealthy.
<p> Note that if a check never completes, we rely on {@link #timeout} instead.
-
setMaxCheckDuration
final Unit setMaxCheckDuration(Duration maxCheckDuration)
The maximum duration that a call to {@link #performCheck()} is allowed to take. If a call takes longer, the service is considered unhealthy.
<p> Note that if a check never completes, we rely on {@link #timeout} instead.
-
getStickyFailures
final Boolean getStickyFailures()
If set, a single health check failure after the initial {@link #STICKY_FAILURES_GRACE_PERIOD} will be result in the service being permanently unhealthy.
-
setStickyFailures
final Unit setStickyFailures(Boolean stickyFailures)
If set, a single health check failure after the initial {@link #STICKY_FAILURES_GRACE_PERIOD} will be result in the service being permanently unhealthy.
-
getStickyFailuresGracePeriod
final Duration getStickyFailuresGracePeriod()
Failures in this period (since the start of the service) are not sticky.
-
setStickyFailuresGracePeriod
final Unit setStickyFailuresGracePeriod(Duration stickyFailuresGracePeriod)
Failures in this period (since the start of the service) are not sticky.
-
-
-
-