add shard id in tps report

pull/37/head
Minh Doan 6 years ago
parent 336656b8f8
commit 35dda18b4d
  1. 3
      consensus/consensus.go
  2. 3
      consensus/consensus_leader.go

@ -148,5 +148,6 @@ func (consensus *Consensus) String() string {
} else { } else {
duty = "VLD" // validator duty = "VLD" // validator
} }
return fmt.Sprintf("[%s, %s, %v, %v, %s]", duty, consensus.priKey, consensus.ShardID, consensus.nodeId, consensus.state) return fmt.Sprintf("[duty:%s, priKey:%s, ShardID:%v, nodeId:%v, state:%s]",
duty, consensus.priKey, consensus.ShardID, consensus.nodeId, consensus.state)
} }

@ -332,7 +332,8 @@ func (consensus *Consensus) processResponseMessage(payload []byte) {
"startTime", startTime, "startTime", startTime,
"endTime", endTime, "endTime", endTime,
"timeElapsed", timeElapsed, "timeElapsed", timeElapsed,
"TPS", float64(numOfTxs)/timeElapsed.Seconds()) "TPS", float64(numOfTxs)/timeElapsed.Seconds(),
"consensus", consensus)
// Send signal to Node so the new block can be added and new round of consensus can be triggered // Send signal to Node so the new block can be added and new round of consensus can be triggered
consensus.ReadySignal <- 1 consensus.ReadySignal <- 1

Loading…
Cancel
Save