Skip to content

Commit 32503b9

Browse files
committed
register labels
1 parent f85ed84 commit 32503b9

File tree

4 files changed

+42
-15
lines changed

4 files changed

+42
-15
lines changed

internal/consensus/metrics.gen.go

+35-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/consensus/metrics.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ type Metrics struct {
8585
// was relevant to the block the node is trying to gather or not.
8686
BlockGossipPartsReceived metrics.Counter `metrics_labels:"matches_current"`
8787

88-
ProposalBlockCreated metrics.Counter `metrics_labels:"success"`
89-
ProposalTxsCount metrics.Gauge
90-
MissingTxsCount metrics.Gauge
88+
ProposalBlockCreatedOnPropose metrics.Counter `metrics_labels:"success"`
89+
ProposalTxs metrics.Gauge
90+
ProposalMissingTxs metrics.Gauge
9191

9292
// QuroumPrevoteMessageDelay is the interval in seconds between the proposal
9393
// timestamp and the timestamp of the earliest prevote that achieved a quorum

internal/consensus/reactor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ func (r *Reactor) handleDataMessage(ctx context.Context, envelope *p2p.Envelope,
11961196
}
11971197
case *tmcons.TxRequest:
11981198
trMsg := msgI.(*TxRequestMessage)
1199-
logger.Info("PSULOG: Received request for Txs", "txKeys", trMsg.TxKeys)
1199+
//logger.Info("PSULOG: Received request for Txs", "txKeys", trMsg.TxKeys)
12001200
var txKeys []types.TxKey
12011201
for _, txKey := range trMsg.TxKeys {
12021202
txKeys = append(txKeys, *txKey)

internal/consensus/state.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ func (cs *State) handleMsg(ctx context.Context, mi msgInfo, fsyncUponCompletion
10301030
err = cs.setProposal(msg.Proposal, mi.ReceiveTime)
10311031
if cs.config.GossipTransactionHashOnly && !cs.isProposer(cs.privValidatorPubKey.Address()) {
10321032
created := cs.tryCreateProposalBlock(msg.Proposal.Height, msg.Proposal.Round, msg.Proposal.Header, msg.Proposal.LastCommit, msg.Proposal.Evidence, msg.Proposal.ProposerAddress)
1033-
cs.metrics.ProposalBlockCreated.With("success", strconv.FormatBool(created)).Add(1)
1033+
cs.metrics.ProposalBlockCreatedOnPropose.With("success", strconv.FormatBool(created)).Add(1)
10341034
if created {
10351035
if fsyncUponCompletion {
10361036
if err := cs.wal.FlushAndSync(); err != nil { // fsync
@@ -2473,11 +2473,11 @@ func (cs *State) tryCreateProposalBlock(height int64, round int32, header types.
24732473
return false
24742474
}
24752475
txKeys := cs.Proposal.TxKeys
2476-
cs.metrics.ProposalTxsCount.Set(float64(len(cs.Proposal.TxKeys)))
2476+
cs.metrics.ProposalTxs.Set(float64(len(cs.Proposal.TxKeys)))
24772477
missingTxKeys := cs.blockExec.GetMissingTxs(txKeys)
24782478
if len(missingTxKeys) != 0 {
24792479
//cs.logger.Info("PSULOG - cannot create block, either proposal is missing or we have missing keys", "proposal", cs.Proposal)
2480-
cs.metrics.MissingTxsCount.Set(float64(len(cs.blockExec.GetMissingTxs(cs.Proposal.TxKeys))))
2480+
cs.metrics.ProposalMissingTxs.Set(float64(len(cs.blockExec.GetMissingTxs(cs.Proposal.TxKeys))))
24812481
return false
24822482
} else {
24832483
//block := types.MakeBlock(height, cs.blockExec.GetTxsForKeys(txKeys), lastCommit, evidence, false)

0 commit comments

Comments
 (0)