github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/internal/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 // EvictedTxs defines the number of evicted transactions. These are valid 35 // transactions that passed CheckTx and existed in the mempool but were later 36 // evicted to make room for higher priority valid transactions that passed 37 // CheckTx. 38 //metrics:Number of evicted transactions. 39 EvictedTxs metrics.Counter 40 41 // Number of times transactions are rechecked in the mempool. 42 RecheckTimes metrics.Counter 43 }