[prometheus] add block number gauge

Signed-off-by: Leo Chen <leo@harmony.one>
pull/3459/head
Leo Chen 4 years ago
parent c2d37b3822
commit c28f6c7ca4
  1. 1
      consensus/consensus_v2.go
  2. 1
      consensus/validator.go

@ -213,6 +213,7 @@ func (consensus *Consensus) finalCommit() {
Int("numStakingTxns", len(block.StakingTransactions())).
Msg("HOORAY!!!!!!! CONSENSUS REACHED!!!!!!!")
ConsensusCounterVec.With(prometheus.Labels{"consensus": "hooray"}).Inc()
ConsensusGaugeVec.With(prometheus.Labels{"consensus": "block_num"}).Set(float64(block.NumberU64()))
ConsensusGaugeVec.With(prometheus.Labels{"consensus": "num_commits"}).Set(float64(consensus.Decider.SignersCount(quorum.Commit)))
// If still the leader, send commit sig/bitmap to finish the new block proposal,

@ -299,6 +299,7 @@ func (consensus *Consensus) onCommitted(msg *msg_pb.Message) {
ConsensusGaugeVec.With(prometheus.Labels{"consensus": "signatures"}).Set(numSig)
ConsensusCounterVec.With(prometheus.Labels{"consensus": "signatures"}).Add(numSig)
ConsensusGaugeVec.With(prometheus.Labels{"consensus": "block_num"}).Set(float64(blockObj.NumberU64()))
initBn := consensus.blockNum
consensus.tryCatchup()

Loading…
Cancel
Save