latestTxHashes.

pull/69/head
Richard Liu 6 years ago
parent c033349e36
commit 24ea87f1de
  1. 8
      consensus/consensus_leader.go

@ -424,8 +424,12 @@ func (consensus *Consensus) reportMetrics(block blockchain.Block) {
"txCount": {strconv.Itoa(int(numOfTxs))},
"nodeCount": {strconv.Itoa(len(consensus.validators) + 1)},
"latestBlockHash": {hex.EncodeToString(consensus.blockHash[:])},
"latestTxHash": {hex.EncodeToString(block.TransactionIds[len(block.TransactionIds)-1][:])},
"blockLatency": {strconv.Itoa(int(timeElapsed / time.Millisecond))},
"latestTxHashes": {
hex.EncodeToString(block.TransactionIds[len(block.TransactionIds)-1][:]),
hex.EncodeToString(block.TransactionIds[len(block.TransactionIds)-2][:]),
hex.EncodeToString(block.TransactionIds[len(block.TransactionIds)-3][:]),
},
"blockLatency": {strconv.Itoa(int(timeElapsed / time.Millisecond))},
}
body := bytes.NewBufferString(form.Encode())

Loading…
Cancel
Save