private TAIHeartbeatReq genMLHeartbeatReq() {
    /* Generate heartbeat request */
    TAIHeartbeatReq heartbeatReq = new TAIHeartbeatReq();
    heartbeatReq.setHeartbeatTimestamp(System.nanoTime());

    // We sample AINode's load in every 10 heartbeat loop
    heartbeatReq.setNeedSamplingLoad(heartbeatCounter.get() % 10 == 0);

    return heartbeatReq;
  }
loop body of the heartbeat thread.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java