github.com/KYVENetwork/cometbft/v38@v38.0.3/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  	// Total size of the mempool in bytes.
    22  	SizeBytes metrics.Gauge
    23  
    24  	// Histogram of transaction sizes in bytes.
    25  	TxSizeBytes metrics.Histogram `metrics_buckettype:"exp" metrics_bucketsizes:"1,3,7"`
    26  
    27  	// Number of failed transactions.
    28  	FailedTxs metrics.Counter
    29  
    30  	// RejectedTxs defines the number of rejected transactions. These are
    31  	// transactions that passed CheckTx but failed to make it into the mempool
    32  	// due to resource limits, e.g. mempool is full and no lower priority
    33  	// transactions exist in the mempool.
    34  	//metrics:Number of rejected transactions.
    35  	RejectedTxs metrics.Counter
    36  
    37  	// EvictedTxs defines the number of evicted transactions. These are valid
    38  	// transactions that passed CheckTx and existed in the mempool but were later
    39  	// evicted to make room for higher priority valid transactions that passed
    40  	// CheckTx.
    41  	//metrics:Number of evicted transactions.
    42  	EvictedTxs metrics.Counter
    43  
    44  	// Number of times transactions are rechecked in the mempool.
    45  	RecheckTimes metrics.Counter
    46  
    47  	// Number of connections being actively used for gossiping transactions
    48  	// (experimental feature).
    49  	ActiveOutboundConnections metrics.Gauge
    50  }