mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-15 23:38:19 +00:00
pool_metrics (#544)
This commit is contained in:
parent
684c3d3697
commit
59aa1c78c7
@ -59,6 +59,9 @@ var (
|
|||||||
propagateToNewPeerTimer = metrics.NewSummary(`pool_propagate_to_new_peer`)
|
propagateToNewPeerTimer = metrics.NewSummary(`pool_propagate_to_new_peer`)
|
||||||
propagateNewTxsTimer = metrics.NewSummary(`pool_propagate_new_txs`)
|
propagateNewTxsTimer = metrics.NewSummary(`pool_propagate_new_txs`)
|
||||||
writeToDBBytesCounter = metrics.GetOrCreateCounter(`pool_write_to_db_bytes`)
|
writeToDBBytesCounter = metrics.GetOrCreateCounter(`pool_write_to_db_bytes`)
|
||||||
|
pendingSubCounter = metrics.GetOrCreateCounter(`txpool_pending`)
|
||||||
|
queuedSubCounter = metrics.GetOrCreateCounter(`txpool_queued`)
|
||||||
|
basefeeSubCounter = metrics.GetOrCreateCounter(`txpool_basefee`)
|
||||||
)
|
)
|
||||||
|
|
||||||
const ASSERT = false
|
const ASSERT = false
|
||||||
@ -1690,16 +1693,13 @@ func (p *TxPool) logStats() {
|
|||||||
//log.Info("[txpool] Not started yet, waiting for new blocks...")
|
//log.Info("[txpool] Not started yet, waiting for new blocks...")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//protocolBaseFee, pendingBaseFee := p.protocolBaseFee.Load(), p.pendingBaseFee.Load()
|
|
||||||
|
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
defer p.lock.RUnlock()
|
defer p.lock.RUnlock()
|
||||||
|
|
||||||
//idsInMem := p.senders.idsCount()
|
|
||||||
var m runtime.MemStats
|
var m runtime.MemStats
|
||||||
common.ReadMemStats(&m)
|
common.ReadMemStats(&m)
|
||||||
ctx := []interface{}{
|
ctx := []interface{}{
|
||||||
//"baseFee", fmt.Sprintf("%d, %dm", protocolBaseFee, pendingBaseFee/1_000_000),
|
|
||||||
"block", p.lastSeenBlock.Load(),
|
"block", p.lastSeenBlock.Load(),
|
||||||
"pending", p.pending.Len(),
|
"pending", p.pending.Len(),
|
||||||
"baseFee", p.baseFee.Len(),
|
"baseFee", p.baseFee.Len(),
|
||||||
@ -1711,22 +1711,9 @@ func (p *TxPool) logStats() {
|
|||||||
}
|
}
|
||||||
ctx = append(ctx, "alloc", common.ByteCount(m.Alloc), "sys", common.ByteCount(m.Sys))
|
ctx = append(ctx, "alloc", common.ByteCount(m.Alloc), "sys", common.ByteCount(m.Sys))
|
||||||
log.Info("[txpool] stat", ctx...)
|
log.Info("[txpool] stat", ctx...)
|
||||||
//if ASSERT {
|
pendingSubCounter.Set(uint64(p.pending.Len()))
|
||||||
//stats := kvcache.DebugStats(p.senders.cache)
|
basefeeSubCounter.Set(uint64(p.baseFee.Len()))
|
||||||
//log.Info(fmt.Sprintf("[txpool] cache %T, roots amount %d", p.senders.cache, len(stats)))
|
queuedSubCounter.Set(uint64(p.queued.Len()))
|
||||||
//for i := range stats {
|
|
||||||
// log.Info("[txpool] cache", "root", stats[i].BlockNum, "len", stats[i].Lenght)
|
|
||||||
//}
|
|
||||||
//stats := kvcache.DebugStats(p.senders.cache)
|
|
||||||
//log.Info(fmt.Sprintf("[txpool] cache %T, roots amount %d", p.senders.cache, len(stats)))
|
|
||||||
//for i := range stats {
|
|
||||||
// log.Info("[txpool] cache", "root", stats[i].BlockNum, "len", stats[i].Lenght)
|
|
||||||
//}
|
|
||||||
//ages := kvcache.DebugAges(p.senders.cache)
|
|
||||||
//for i := range ages {
|
|
||||||
// log.Info("[txpool] age", "age", ages[i].BlockNum, "amount", ages[i].Lenght)
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deprecated need switch to streaming-like
|
//Deprecated need switch to streaming-like
|
||||||
|
Loading…
Reference in New Issue
Block a user