code: @Override
    protected void startUp() throws Exception {
      initialTimeout = Executors.newScheduledThreadPool(1).schedule(
        new Runnable() {
        @Override
        public void run() {
          if (modelCounter.size() <= 0) {
            LOG.info("Heartbeat detection failed");
            serviceFailed.notifyFailure(null);
          }
        }
      }, Constants.INITIALIZATION_TIMEOUT, TimeUnit.SECONDS);
      monitorFuture = Executors.newScheduledThreadPool(1).scheduleWithFixedDelay(
        new Runnable() {
          @Override
          public void run() {
            if (!checkState()) {
              Set<String> missingHeartbeatRecord = Sets.newHashSet(modelCounter);
              missingHeartbeatRecord.removeAll(heartbeatCounter);
              serviceFailed.notifyFailure(missingHeartbeatRecord);
            }
          }
        }, 2 * Constants.HEARTBEAT_FREQUENCY
        , Constants.HEARTBEAT_FREQUENCY
        , TimeUnit.SECONDS);
    }
docs: This function initiates the monitoring services that checks if a heartbeat from each registered process was
  detected in the last 2 seconds. In case of failure, {@link ProcessMonitor#notifyFailure(java.util.Set)} of the
  constructor's parameter object is invoked.