github.com/aakash4dev/cometbft@v0.38.2/mempool/metrics.go (about) 1 package mempool 2 3 import ( 4 "github.com/go-kit/kit/metrics" 5 ) 6 7 const ( 8 // MetricsSubsystem is a subsystem shared by all metrics exposed by this 9 // package. 10 MetricsSubsystem = "mempool" 11 ) 12 13 //go:generate go run ../scripts/metricsgen -struct=Metrics 14 15 // Metrics contains metrics exposed by this package. 16 // see MetricsProvider for descriptions. 17 type Metrics struct { 18 // Number of uncommitted transactions in the mempool. 19 Size metrics.Gauge 20 21 // Histogram of transaction sizes in bytes. 22 TxSizeBytes metrics.Histogram `metrics_buckettype:"exp" metrics_bucketsizes:"1,3,7"` 23 24 // Number of failed transactions. 25 FailedTxs metrics.Counter 26 27 // RejectedTxs defines the number of rejected transactions. These are 28 // transactions that passed CheckTx but failed to make it into the mempool 29 // due to resource limits, e.g. mempool is full and no lower priority 30 // transactions exist in the mempool. 31 //metrics:Number of rejected transactions. 32 RejectedTxs metrics.Counter 33 34 // Number of times transactions are rechecked in the mempool. 35 RecheckTimes metrics.Counter 36 37 // Number of times transactions were received more than once. 38 //metrics:Number of duplicate transaction reception. 39 AlreadyReceivedTxs metrics.Counter 40 }