code: public void heartbeat(final String appName, final String id,
                            final InstanceInfo info, final InstanceStatus overriddenStatus,
                            boolean primeConnection) throws Throwable {
          if (primeConnection) {
              // We do not care about the result for priming request.
              replicationClient.sendHeartBeat(appName, id, info, overriddenStatus);
              return;
          }
          ReplicationTask replicationTask = new InstanceReplicationTask(targetHost, Action.Heartbeat, info, overriddenStatus, false) {
              @Override
              public EurekaHttpResponse<InstanceInfo> execute() throws Throwable {
                  return replicationClient.sendHeartBeat(appName, id, info, overriddenStatus);
              }
  
              @Override
              public void handleFailure(int statusCode, Object responseEntity) throws Throwable {
                  super.handleFailure(statusCode, responseEntity);
                  if (statusCode == 404) {
                      logger.warn("{}: missing entry.", getTaskName());
                      if (info != null) {
                          logger.warn("{}: cannot find instance id {} and hence replicating the instance with status {}",
                                  getTaskName(), info.getId(), info.getStatus());
                          register(info);
                      }
                  } else if (config.shouldSyncWhenTimestampDiffers()) {
                      InstanceInfo peerInstanceInfo = (InstanceInfo) responseEntity;
                      if (peerInstanceInfo != null) {
                          syncInstancesIfTimestampDiffers(appName, id, info, peerInstanceInfo);
                      }
                  }
              }
          };
          long expiryTime = System.currentTimeMillis() + getLeaseRenewalOf(info);
          batchingDispatcher.process(taskId("heartbeat", info), replicationTask, expiryTime);
      }
docs: Send the heartbeat information of an instance to the node represented by
  this class. If the instance does not exist the node, the instance
  registration information is sent again to the peer node.
  
  @param appName
  the application name of the instance.
  @param id
  the unique identifier of the instance.
  @param info
  the instance info {@link InstanceInfo} of the instance.
  @param overriddenStatus
  the overridden status information if any of the instance.
  @throws Throwable