Skip to content

Commit 63c8e2e

Browse files
committed
adjust metrics to better spot
1 parent ffc06ad commit 63c8e2e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/mempool/mempool.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -665,15 +665,11 @@ func (txmp *TxMempool) addNewTransaction(wtx *WrappedTx, res *abci.ResponseCheck
665665
txInfo.SenderID: {},
666666
}
667667

668-
txmp.metrics.Size.Set(float64(txmp.SizeWithoutPending()))
669-
txmp.metrics.PendingSize.Set(float64(txmp.PendingSize()))
670-
671668
if txmp.isInMempool(wtx.tx) {
672669
return nil
673670
}
674671

675672
if txmp.insertTx(wtx) {
676-
txmp.metrics.TxSizeBytes.Observe(float64(wtx.Size()))
677673
txmp.logger.Debug(
678674
"inserted good transaction",
679675
"priority", wtx.priority,
@@ -872,6 +868,10 @@ func (txmp *TxMempool) insertTx(wtx *WrappedTx) bool {
872868
if !inserted {
873869
return false
874870
}
871+
txmp.metrics.TxSizeBytes.Observe(float64(wtx.Size()))
872+
txmp.metrics.Size.Set(float64(txmp.SizeWithoutPending()))
873+
txmp.metrics.PendingSize.Set(float64(txmp.PendingSize()))
874+
875875
if replacedTx != nil {
876876
txmp.removeTx(replacedTx, true, false, false)
877877
}

0 commit comments

Comments
 (0)