mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
ethdb/pebble: track iterator number
This commit is contained in:
parent
75e40f951c
commit
1370ed79fb
1 changed files with 3 additions and 0 deletions
|
|
@ -83,6 +83,7 @@ type Database struct {
|
||||||
estimatedCompDebtGauge *metrics.Gauge // Gauge for tracking the number of bytes that need to be compacted
|
estimatedCompDebtGauge *metrics.Gauge // Gauge for tracking the number of bytes that need to be compacted
|
||||||
liveCompGauge *metrics.Gauge // Gauge for tracking the number of in-progress compactions
|
liveCompGauge *metrics.Gauge // Gauge for tracking the number of in-progress compactions
|
||||||
liveCompSizeGauge *metrics.Gauge // Gauge for tracking the size of in-progress compactions
|
liveCompSizeGauge *metrics.Gauge // Gauge for tracking the size of in-progress compactions
|
||||||
|
liveIterGauge *metrics.Gauge // Gauge for tracking the number of live database iterators
|
||||||
levelsGauge []*metrics.Gauge // Gauge for tracking the number of tables in levels
|
levelsGauge []*metrics.Gauge // Gauge for tracking the number of tables in levels
|
||||||
|
|
||||||
quitLock sync.RWMutex // Mutex protecting the quit channel and the closed flag
|
quitLock sync.RWMutex // Mutex protecting the quit channel and the closed flag
|
||||||
|
|
@ -326,6 +327,7 @@ func New(file string, cache int, handles int, namespace string, readonly bool) (
|
||||||
db.estimatedCompDebtGauge = metrics.GetOrRegisterGauge(namespace+"compact/estimateDebt", nil)
|
db.estimatedCompDebtGauge = metrics.GetOrRegisterGauge(namespace+"compact/estimateDebt", nil)
|
||||||
db.liveCompGauge = metrics.GetOrRegisterGauge(namespace+"compact/live/count", nil)
|
db.liveCompGauge = metrics.GetOrRegisterGauge(namespace+"compact/live/count", nil)
|
||||||
db.liveCompSizeGauge = metrics.GetOrRegisterGauge(namespace+"compact/live/size", nil)
|
db.liveCompSizeGauge = metrics.GetOrRegisterGauge(namespace+"compact/live/size", nil)
|
||||||
|
db.liveIterGauge = metrics.GetOrRegisterGauge(namespace+"iter/count", nil)
|
||||||
|
|
||||||
// Start up the metrics gathering and return
|
// Start up the metrics gathering and return
|
||||||
go db.meter(metricsGatheringInterval, namespace)
|
go db.meter(metricsGatheringInterval, namespace)
|
||||||
|
|
@ -582,6 +584,7 @@ func (d *Database) meter(refresh time.Duration, namespace string) {
|
||||||
d.seekCompGauge.Update(stats.Compact.ReadCount)
|
d.seekCompGauge.Update(stats.Compact.ReadCount)
|
||||||
d.liveCompGauge.Update(stats.Compact.NumInProgress)
|
d.liveCompGauge.Update(stats.Compact.NumInProgress)
|
||||||
d.liveCompSizeGauge.Update(stats.Compact.InProgressBytes)
|
d.liveCompSizeGauge.Update(stats.Compact.InProgressBytes)
|
||||||
|
d.liveIterGauge.Update(stats.TableIters)
|
||||||
|
|
||||||
d.liveMemTablesGauge.Update(stats.MemTable.Count)
|
d.liveMemTablesGauge.Update(stats.MemTable.Count)
|
||||||
d.zombieMemTablesGauge.Update(stats.MemTable.ZombieCount)
|
d.zombieMemTablesGauge.Update(stats.MemTable.ZombieCount)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue