log size of messages in log file

Signed-off-by: Leo Chen <leo@harmony.one>
pull/76/head
Leo Chen 6 years ago
parent 13dfea2e84
commit e8b6a45fe0
  1. 3
      consensus/consensus_validator.go
  2. 2
      p2p/peer.go

@ -27,7 +27,6 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte) {
consensus.Log.Error("Failed to get consensus message payload", "err", err, "consensus", consensus)
}
consensus.Log.Info("Received consensus Message", "type", msgType)
switch msgType {
case proto_consensus.Announce:
consensus.processAnnounceMessage(payload)
@ -44,7 +43,7 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte) {
// Processes the announce message sent from the leader
func (consensus *Consensus) processAnnounceMessage(payload []byte) {
consensus.Log.Info("Received Announce Message")
consensus.Log.Info("Received Announce Message", "Size", len(payload))
//#### Read payload data
offset := 0
// 4 byte consensus id

@ -42,7 +42,7 @@ func BroadcastMessage(peers []Peer, msg []byte) {
// Construct broadcast p2p message
content := ConstructP2pMessage(byte(17), msg)
log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0))
log.Info("Start Broadcasting", "gomaxprocs", runtime.GOMAXPROCS(0), "Size", len(content))
start := time.Now()
for _, peer := range peers {
peerCopy := peer

Loading…
Cancel
Save