use of com.hazelcast.internal.cluster.impl.ClusterHeartbeatManager in project hazelcast by hazelcast.
the class MemberHeartbeatPlugin method render.
private void render(DiagnosticsLogWriter writer, ClusterServiceImpl clusterService) {
ClusterHeartbeatManager clusterHeartbeatManager = clusterService.getClusterHeartbeatManager();
long expectedIntervalMillis = clusterHeartbeatManager.getHeartbeatIntervalMillis();
long nowMillis = System.currentTimeMillis();
for (MemberImpl member : clusterService.getMemberImpls()) {
long lastHeartbeatMillis = clusterHeartbeatManager.getLastHeartbeatTime(member);
if (lastHeartbeatMillis == 0L) {
// member without a heartbeat; lets skip it
continue;
}
long noHeartbeatMillis = nowMillis - lastHeartbeatMillis;
float deviation = HUNDRED * ((float) (noHeartbeatMillis - expectedIntervalMillis)) / expectedIntervalMillis;
if (deviation >= maxDeviationPercentage) {
startLazyMainSection(writer);
writer.startSection("member" + member.getAddress());
writer.writeKeyValueEntry("deviation(%)", deviation);
writer.writeKeyValueEntry("noHeartbeat(ms)", noHeartbeatMillis);
writer.writeKeyValueEntry("lastHeartbeat(ms)", lastHeartbeatMillis);
writer.writeKeyValueEntryAsDateTime("lastHeartbeat(date-time)", lastHeartbeatMillis);
writer.writeKeyValueEntry("now(ms)", nowMillis);
writer.writeKeyValueEntryAsDateTime("now(date-time)", nowMillis);
writer.endSection();
}
}
endLazyMainSection(writer);
}
use of com.hazelcast.internal.cluster.impl.ClusterHeartbeatManager in project hazelcast by hazelcast.
the class HeartbeatComplaintOp method run.
@Override
public void run() throws Exception {
ClusterServiceImpl service = getService();
ClusterHeartbeatManager heartbeatManager = service.getClusterHeartbeatManager();
heartbeatManager.handleHeartbeatComplaint(receiverMembersViewMetadata, senderMembersViewMetadata);
}
use of com.hazelcast.internal.cluster.impl.ClusterHeartbeatManager in project hazelcast by hazelcast.
the class HeartbeatOp method run.
@Override
public void run() {
ClusterServiceImpl service = getService();
ClusterHeartbeatManager heartbeatManager = service.getClusterHeartbeatManager();
heartbeatManager.handleHeartbeat(senderMembersViewMetadata, targetUuid, timestamp, suspectedMembers);
}
Aggregations