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.

    • Method Detail

      • getInterval

         final Duration getInterval()

        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.

      • run

         Unit run()

        Performs a health check and updates this instance's state. Runs periodically in {@link #executor}.