mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
core/txpool/legacypool: add metric for accounts in txpool queue
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
0827d803d2
commit
dece8b9369
2 changed files with 4 additions and 0 deletions
|
|
@ -115,6 +115,7 @@ var (
|
||||||
slotsGauge = metrics.NewRegisteredGauge("txpool/slots", nil)
|
slotsGauge = metrics.NewRegisteredGauge("txpool/slots", nil)
|
||||||
|
|
||||||
pendingAddrsGauge = metrics.NewRegisteredGauge("txpool/pending/accounts", nil)
|
pendingAddrsGauge = metrics.NewRegisteredGauge("txpool/pending/accounts", nil)
|
||||||
|
queuedAddrsGauge = metrics.NewRegisteredGauge("txpool/queued/accounts", nil)
|
||||||
|
|
||||||
reheapTimer = metrics.NewRegisteredTimer("txpool/reheap", nil)
|
reheapTimer = metrics.NewRegisteredTimer("txpool/reheap", nil)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ func (q *queue) remove(addr common.Address, tx *types.Transaction) {
|
||||||
if future.Empty() {
|
if future.Empty() {
|
||||||
delete(q.queued, addr)
|
delete(q.queued, addr)
|
||||||
delete(q.beats, addr)
|
delete(q.beats, addr)
|
||||||
|
queuedAddrsGauge.Dec(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -123,6 +124,7 @@ func (q *queue) add(tx *types.Transaction) (*common.Hash, error) {
|
||||||
from, _ := types.Sender(q.signer, tx) // already validated
|
from, _ := types.Sender(q.signer, tx) // already validated
|
||||||
if q.queued[from] == nil {
|
if q.queued[from] == nil {
|
||||||
q.queued[from] = newList(false)
|
q.queued[from] = newList(false)
|
||||||
|
queuedAddrsGauge.Inc(1)
|
||||||
}
|
}
|
||||||
inserted, old := q.queued[from].Add(tx, q.config.PriceBump)
|
inserted, old := q.queued[from].Add(tx, q.config.PriceBump)
|
||||||
if !inserted {
|
if !inserted {
|
||||||
|
|
@ -200,6 +202,7 @@ func (q *queue) promoteExecutables(accounts []common.Address, gasLimit uint64, c
|
||||||
if list.Empty() {
|
if list.Empty() {
|
||||||
delete(q.queued, addr)
|
delete(q.queued, addr)
|
||||||
delete(q.beats, addr)
|
delete(q.beats, addr)
|
||||||
|
queuedAddrsGauge.Dec(1)
|
||||||
removedAddresses = append(removedAddresses, addr)
|
removedAddresses = append(removedAddresses, addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue