Merge pull request #1541 from denniswon/tps_fix

nit: fix error log consensus:marshaling error: json: unsupported type: chan []uint8
pull/1549/head
Dennis JongHyuck Won 5 years ago committed by GitHub
commit 9eed9e8a83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      consensus/consensus_service.go
  2. 3
      consensus/consensus_v2.go

@ -412,13 +412,12 @@ func (consensus *Consensus) reportMetrics(block types.Block) {
timeElapsed := endTime.Sub(startTime)
numOfTxs := len(block.Transactions())
tps := float64(numOfTxs) / timeElapsed.Seconds()
utils.Logger().Info().
consensus.getLogger().Info().
Int("numOfTXs", numOfTxs).
Time("startTime", startTime).
Time("endTime", endTime).
Dur("timeElapsed", endTime.Sub(startTime)).
Float64("TPS", tps).
Interface("consensus", consensus).
Msg("TPS Report")
// Post metrics

@ -33,7 +33,7 @@ func (consensus *Consensus) handleMessageUpdate(payload []byte) {
msg := &msg_pb.Message{}
err := protobuf.Unmarshal(payload, msg)
if err != nil {
utils.Logger().Error().Err(err).Interface("consensus", consensus).Msg("Failed to unmarshal message payload.")
consensus.getLogger().Error().Err(err).Msg("Failed to unmarshal message payload.")
return
}
@ -1161,7 +1161,6 @@ func (consensus *Consensus) Start(blockChannel chan *types.Block, stopChan chan
consensus.getLogger().Debug().
Int("numTxs", len(newBlock.Transactions())).
Interface("consensus", consensus).
Time("startTime", startTime).
Int("publicKeys", len(consensus.PublicKeys)).
Msg("[ConsensusMainLoop] STARTING CONSENSUS")

Loading…
Cancel
Save