private boolean decideToStop() {
    boolean stop = false;
    if (numTimesUnhealthy == 0) {
      // First time we are seeing a failure. No need to stop, just
      // record the time.
      numTimesUnhealthy++;
      startWindow = EnvironmentEdgeManager.currentTime();
    } else {
      if ((EnvironmentEdgeManager.currentTime() - startWindow) < failureWindow) {
        numTimesUnhealthy++;
        if (numTimesUnhealthy == threshold) {
          stop = true;
        } else {
          stop = false;
        }
      } else {
        // Outside of failure window, so we reset to 1.
        numTimesUnhealthy = 1;
        startWindow = EnvironmentEdgeManager.currentTime();
        stop = false;
      }
    }
    return stop;
  }
The Class HealthCheckChore for running health checker regularly.
hbase-server/src/main/java/org/apache/hadoop/hbase/HealthCheckChore.java