Class HealthRunner

java.lang.Object
com.kingsrook.qqq.backend.core.health.HealthRunner
All Implemented Interfaces:
AutoCloseable

public class HealthRunner extends Object implements AutoCloseable
Slot-leased health execution. Probe threads are bounded even if interruption is ignored. Every worker installs and clears its own automated QContext.
  • Constructor Details

    • HealthRunner

      public HealthRunner(QInstance qInstance, String podId, Clock clock)
      Construction does not schedule work. Clock and randomness are injectable.
  • Method Details

    • withRandom

      public HealthRunner withRandom(Random random)
      Configure deterministic jitter before starting this runner.
    • getForInstance

      public static HealthRunner getForInstance(QInstance qInstance)
      Find the runner started for this instance in this JVM.
    • getLastOutcome

      public HealthCheckOutcome getLastOutcome(String name)
      Last sanitized outcome, including probes made during a storage outage.
    • getLastOutcomeAt

      public Instant getLastOutcomeAt(String name)
      Completion time used by readiness to reject stale cached results.
    • start

      public void start() throws QException
      Synchronize definitions before beginning fixed-delay ticks.
      Throws:
      QException
    • stop

      public void stop()
      Stop scheduling and interrupt probes; daemon threads cannot hold shutdown.
    • close

      public void close()
      Close transient runners after record actions.
      Specified by:
      close in interface AutoCloseable
    • tick

      public void tick()
      Public deterministic tick. Launch all available probes before awaiting any.
    • runNow

      public HealthCheckOutcome runNow(String checkName) throws QException
      On-demand uses a unique request id and deliberately ignores enabled.
      Throws:
      QException