mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-28 14:47:16 +00:00
mdbx more metrics (#613)
This commit is contained in:
parent
393fcf6856
commit
22beae4579
2
go.mod
2
go.mod
@ -19,7 +19,7 @@ require (
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.21
|
||||
github.com/spaolacci/murmur3 v1.1.0
|
||||
github.com/stretchr/testify v1.8.0
|
||||
github.com/torquem-ch/mdbx-go v0.25.2
|
||||
github.com/torquem-ch/mdbx-go v0.25.3
|
||||
go.uber.org/atomic v1.10.0
|
||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
|
||||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
|
||||
|
4
go.sum
4
go.sum
@ -110,8 +110,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/torquem-ch/mdbx-go v0.25.2 h1:Ub5M0krJRv4SJCh1GjNmQGTaDjWKH0YaSTH+S3DmYV4=
|
||||
github.com/torquem-ch/mdbx-go v0.25.2/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
|
||||
github.com/torquem-ch/mdbx-go v0.25.3 h1:Moz3A/KERndd2aeLGygeD6zC6ZedyuFdw1pdBQRf6N8=
|
||||
github.com/torquem-ch/mdbx-go v0.25.3/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
|
||||
github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8=
|
||||
github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
|
||||
github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ=
|
||||
|
@ -43,14 +43,15 @@ var (
|
||||
DbCommitEnding = metrics.GetOrCreateSummary(`db_commit_seconds{phase="ending"}`) //nolint
|
||||
DbCommitTotal = metrics.GetOrCreateSummary(`db_commit_seconds{phase="total"}`) //nolint
|
||||
|
||||
DbPgopsNewly = metrics.NewCounter(`db_pgops_newly`) //nolint
|
||||
DbPgopsCow = metrics.NewCounter(`db_pgops_cow`) //nolint
|
||||
DbPgopsClone = metrics.NewCounter(`db_pgops_clone`) //nolint
|
||||
DbPgopsSplit = metrics.NewCounter(`db_pgops_split`) //nolint
|
||||
DbPgopsMerge = metrics.NewCounter(`db_pgops_merge`) //nolint
|
||||
DbPgopsSpill = metrics.NewCounter(`db_pgops_spill`) //nolint
|
||||
DbPgopsUnspill = metrics.NewCounter(`db_pgops_unspill`) //nolint
|
||||
DbPgopsWops = metrics.NewCounter(`db_pgops_wops`) //nolint
|
||||
DbPgopsNewly = metrics.NewCounter(`db_pgops_newly`) //nolint
|
||||
DbPgopsCow = metrics.NewCounter(`db_pgops_cow`) //nolint
|
||||
DbPgopsClone = metrics.NewCounter(`db_pgops_clone`) //nolint
|
||||
DbPgopsSplit = metrics.NewCounter(`db_pgops_split`) //nolint
|
||||
DbPgopsMerge = metrics.NewCounter(`db_pgops_merge`) //nolint
|
||||
DbPgopsSpill = metrics.NewCounter(`db_pgops_spill`) //nolint
|
||||
DbPgopsUnspill = metrics.NewCounter(`db_pgops_unspill`) //nolint
|
||||
DbPgopsWops = metrics.NewCounter(`db_pgops_wops`) //nolint
|
||||
DbPgopsGcrtime = metrics.GetOrCreateSummary(`db_pgops_gcrtime`) //nolint
|
||||
|
||||
GcLeafMetric = metrics.NewCounter(`db_gc_leaf`) //nolint
|
||||
GcOverflowMetric = metrics.NewCounter(`db_gc_overflow`) //nolint
|
||||
|
@ -593,6 +593,7 @@ func (tx *MdbxTx) CollectMetrics() {
|
||||
kv.DbPgopsSpill.Set(info.PageOps.Spill)
|
||||
kv.DbPgopsUnspill.Set(info.PageOps.Unspill)
|
||||
kv.DbPgopsWops.Set(info.PageOps.Wops)
|
||||
kv.DbPgopsGcrtime.Update(info.PageOps.Gcrtime.Seconds())
|
||||
|
||||
txInfo, err := tx.tx.Info(true)
|
||||
if err != nil {
|
||||
@ -611,49 +612,6 @@ func (tx *MdbxTx) CollectMetrics() {
|
||||
kv.GcLeafMetric.Set(gc.LeafPages)
|
||||
kv.GcOverflowMetric.Set(gc.OverflowPages)
|
||||
kv.GcPagesMetric.Set((gc.LeafPages + gc.OverflowPages) * tx.db.opts.pageSize / 8)
|
||||
|
||||
{
|
||||
st, err := tx.BucketStat(kv.PlainState)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
kv.TableStateLeaf.Set(st.LeafPages)
|
||||
kv.TableStateBranch.Set(st.BranchPages)
|
||||
kv.TableStateEntries.Set(st.Entries)
|
||||
kv.TableStateSize.Set((st.LeafPages + st.BranchPages + st.OverflowPages) * tx.db.opts.pageSize)
|
||||
}
|
||||
{
|
||||
st, err := tx.BucketStat(kv.StorageChangeSet)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
kv.TableScsLeaf.Set(st.LeafPages)
|
||||
kv.TableScsBranch.Set(st.BranchPages)
|
||||
kv.TableScsEntries.Set(st.Entries)
|
||||
kv.TableScsSize.Set((st.LeafPages + st.BranchPages + st.OverflowPages) * tx.db.opts.pageSize)
|
||||
}
|
||||
{
|
||||
st, err := tx.BucketStat(kv.EthTx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
kv.TableTxLeaf.Set(st.LeafPages)
|
||||
kv.TableTxBranch.Set(st.BranchPages)
|
||||
kv.TableTxOverflow.Set(st.OverflowPages)
|
||||
kv.TableTxEntries.Set(st.Entries)
|
||||
kv.TableTxSize.Set((st.LeafPages + st.BranchPages + st.OverflowPages) * tx.db.opts.pageSize)
|
||||
}
|
||||
{
|
||||
st, err := tx.BucketStat(kv.Log)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
kv.TableLogLeaf.Set(st.LeafPages)
|
||||
kv.TableLogBranch.Set(st.BranchPages)
|
||||
kv.TableLogOverflow.Set(st.OverflowPages)
|
||||
kv.TableLogEntries.Set(st.Entries)
|
||||
kv.TableLogSize.Set((st.LeafPages + st.BranchPages + st.OverflowPages) * tx.db.opts.pageSize)
|
||||
}
|
||||
}
|
||||
|
||||
// ListBuckets - all buckets stored as keys of un-named bucket
|
||||
|
Loading…
Reference in New Issue
Block a user