mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
28 lines
1.1 KiB
Go
28 lines
1.1 KiB
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package txpool
|
|
|
|
import (
|
|
metricspkg "github.com/luxfi/geth/metrics"
|
|
)
|
|
|
|
type metrics struct {
|
|
pendingTxs *metricspkg.Gauge // Gauge of currently pending transactions in the txHeap
|
|
currentTxs *metricspkg.Gauge // Gauge of current transactions to be issued into a block
|
|
issuedTxs *metricspkg.Gauge // Gauge of transactions that have been issued into a block
|
|
|
|
addedTxs *metricspkg.Counter // Count of all transactions added to the mempool
|
|
discardedTxs *metricspkg.Counter // Count of all discarded transactions
|
|
}
|
|
|
|
func newMetrics() *metrics {
|
|
m := &metrics{}
|
|
m.pendingTxs = metricspkg.GetOrRegisterGauge("atomic_mempool_pending_txs", nil)
|
|
m.currentTxs = metricspkg.GetOrRegisterGauge("atomic_mempool_current_txs", nil)
|
|
m.issuedTxs = metricspkg.GetOrRegisterGauge("atomic_mempool_issued_txs", nil)
|
|
m.addedTxs = metricspkg.GetOrRegisterCounter("atomic_mempool_added_txs", nil)
|
|
m.discardedTxs = metricspkg.GetOrRegisterCounter("atomic_mempool_discarded_txs", nil)
|
|
return m
|
|
}
|