Class PingCheckMonitor

java.lang.Object
io.appform.ranger.core.healthservice.monitor.IsolatedHealthMonitor<HealthcheckStatus>
io.appform.ranger.core.healthservice.monitor.sample.PingCheckMonitor
All Implemented Interfaces:
Monitor<HealthcheckStatus>, Runnable

public class PingCheckMonitor extends IsolatedHealthMonitor<HealthcheckStatus>
A Ping checking monitor, which executes a HttpRequest at regular intervals Maintains every healthcheck in a RollingWindowHealthQueue to prevent continuous flaps of health
  • Constructor Details

    • PingCheckMonitor

      public PingCheckMonitor(TimeEntity timeEntity, org.apache.http.HttpRequest httpRequest, Integer pingTimeoutInMilliseconds, Integer pingWindowSize, Integer maxFailures, String host, Integer port)
      Parameters:
      timeEntity - how often the monitor() check needs to be executed
      httpRequest - http request that will be called at regular intervals
      pingTimeoutInMilliseconds - timeout in milliseconds for http request execution (ping response)
      pingWindowSize - rolling window frame, which needs to be maintained
      maxFailures - maximum failures allowed in the rolling window frame
      host - host name (could be localhost)
      port - port
  • Method Details

    • monitor

      public HealthcheckStatus monitor()
      Description copied from interface: Monitor
      trigger a single check of the monitor service
      Returns:
      status of check