Commit 5d2af3e2 authored by duanjinfei's avatar duanjinfei

add nm heartbeat time monitor

parent e9197869
......@@ -83,6 +83,11 @@ func StartMonitor() {
log.Info("Monitoring node manager client thread start......")
for _, managerClient := range usedNodeManagerClient {
log.WithField("Status", managerClient.Status).WithField("Is Del", managerClient.IsDel).WithField("EndPoint", managerClient.Endpoint).Info("Monitoring node manager client thread")
sub := time.Now().Sub(managerClient.GetLastHeartTime()).Seconds()
log.WithField("time(uint seconds)", sub).Info("Main thread monitor nm heartbeat time")
if int64(sub) > conf.GetConfig().HeartRespTimeSecond {
managerClient.UpdateStatus(false)
}
if !managerClient.GetStatus() && !managerClient.IsDel {
log.Warn("The Node manager client is failed:", managerClient.Endpoint)
manager := getNodeManager(managerClient.Endpoint)
......@@ -198,7 +203,7 @@ func monitorWorker(op *operate.DockerOp) {
log.Info("------------------------Start rev msg worker thread------------------------")
for {
sub := time.Now().Sub(nodeManager.GetLastHeartTime()).Seconds()
log.WithField("time(uint seconds)", sub).Info("The time difference since the last heartbeat")
log.WithField("time(uint seconds)", sub).Info("Handler nm msg thread monitor heartbeat time")
rev, err := worker.Recv()
if int64(sub) > conf.GetConfig().HeartRespTimeSecond || err != nil {
log.Error("Rev failed:", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment