SzyWilliam commented on code in PR #14866:
URL: https://github.com/apache/iotdb/pull/14866#discussion_r1971724921
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/detector/PhiAccrualDetector.java:
##########
@@ -54,8 +56,21 @@ public boolean isAvailable(List<AbstractHeartbeatSample>
history) {
return true;
}
final PhiAccrual phiAccrual = create(history);
- // TODO(szywilliam) we should log the status change and dump the heartbeat
history
- return phiAccrual.phi() < (double) this.threshold;
+ final boolean isAvailable = phiAccrual.phi() < (double) this.threshold;
+ if (!isAvailable) {
+ // log the status change and dump the heartbeat history for analysis use
+ final StringBuilder builder = new StringBuilder();
+ builder.append("[");
+ for (double interval : phiAccrual.heartbeatIntervals) {
+ final long msInterval = (long) interval / 1000_000;
+ builder.append(msInterval).append(", ");
+ }
+ builder.append(phiAccrual.timeElapsedSinceLastHeartbeat / 1000_000);
+ builder.append("]");
+ LOGGER.info(String.format("Node Down, heartbeat history (ms): %s",
builder));
+ }
+
Review Comment:
It is auto-generated by spotless.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]