From 35dda18b4dc7e45317dc034f8a5f09499f3a5f1e Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Tue, 10 Jul 2018 12:51:24 -0700 Subject: [PATCH] add shard id in tps report --- consensus/consensus.go | 3 ++- consensus/consensus_leader.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/consensus/consensus.go b/consensus/consensus.go index f105b615c..2db5f3b6f 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -148,5 +148,6 @@ func (consensus *Consensus) String() string { } else { 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) } diff --git a/consensus/consensus_leader.go b/consensus/consensus_leader.go index 17146d277..850d54430 100644 --- a/consensus/consensus_leader.go +++ b/consensus/consensus_leader.go @@ -332,7 +332,8 @@ func (consensus *Consensus) processResponseMessage(payload []byte) { "startTime", startTime, "endTime", endTime, "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 consensus.ReadySignal <- 1