MCPcopy
hub / github.com/dgraph-io/dgraph / ReportRaftComms

Method ReportRaftComms

conn/node.go:151–162  ·  view source on GitHub ↗

ReportRaftComms periodically prints the state of the node (heartbeats in and out).

()

Source from the content-addressed store, hash-verified

149
150// ReportRaftComms periodically prints the state of the node (heartbeats in and out).
151func (n *Node) ReportRaftComms() {
152 if !glog.V(3) {
153 return
154 }
155 ticker := time.Tick(time.Second)
156
157 for range ticker {
158 out := atomic.SwapInt64(&n.heartbeatsOut, 0)
159 in := atomic.SwapInt64(&n.heartbeatsIn, 0)
160 glog.Infof("RaftComm: [%#x] Heartbeats out: %d, in: %d", n.Id, out, in)
161 }
162}
163
164// SetRaft would set the provided raft.Node to this node.
165// It would check fail if the node is already set.

Callers 2

initAndStartNodeMethod · 0.80
RunMethod · 0.80

Calls 1

InfofMethod · 0.80

Tested by

no test coverage detected