From 4213561e79eb7df6a4fd27c4c11750cbc81e10b4 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Tue, 16 Aug 2022 18:56:15 -0400 Subject: [PATCH] add missing metrics methods --- consensus/metrics.go | 13 +++++++++++++ state/execution.go | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/consensus/metrics.go b/consensus/metrics.go index 4121df9bf..6ba132b29 100644 --- a/consensus/metrics.go +++ b/consensus/metrics.go @@ -123,6 +123,14 @@ func (m *Metrics) RecordConsMetrics(block *types.Block) { m.CommittedHeight.Set(float64(block.Height)) } +func (m *Metrics) MarkProposalProcessed(accepted bool) { + status := "accepted" + if !accepted { + status = "rejected" + } + m.ProposalReceiveCount.With("status", status).Add(1) +} + func (m *Metrics) MarkVoteReceived(vt tmproto.SignedMsgType, power, totalPower int64) { p := float64(power) / float64(totalPower) n := strings.ToLower(strings.TrimPrefix(vt.String(), "SIGNED_MSG_TYPE_")) @@ -135,6 +143,11 @@ func (m *Metrics) MarkRound(r int32, st time.Time) { m.RoundDurationSeconds.Observe(roundTime) } +func (m *Metrics) MarkLateVote(vt tmproto.SignedMsgType) { + n := strings.ToLower(strings.TrimPrefix(vt.String(), "SIGNED_MSG_TYPE_")) + m.LateVotes.With("vote_type", n).Add(1) +} + func (m *Metrics) MarkStep(s cstypes.RoundStepType) { if !m.stepStart.IsZero() { stepTime := time.Since(m.stepStart).Seconds() diff --git a/state/execution.go b/state/execution.go index 1cfa4fb72..fc34f8364 100644 --- a/state/execution.go +++ b/state/execution.go @@ -233,10 +233,6 @@ func (blockExec *BlockExecutor) ApplyBlock( } if len(validatorUpdates) > 0 { blockExec.logger.Debug("updates to validators", "updates", types.ValidatorListString(validatorUpdates)) - blockExec.metrics.ValidatorSetUpdates.Add(1) - } - if finalizeBlockResponse.ConsensusParamUpdates != nil { - blockExec.metrics.ConsensusParamUpdates.Add(1) } // Update the state with the block and responses.