mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
add swap metrics (#2333)
This commit is contained in:
parent
e340fa0deb
commit
7cbe6e9f28
@ -142,6 +142,9 @@ func CollectProcessMetrics(refresh time.Duration) {
|
|||||||
vmemDirty = GetOrRegisterGauge("vmem/dirty", DefaultRegistry)
|
vmemDirty = GetOrRegisterGauge("vmem/dirty", DefaultRegistry)
|
||||||
vmemShared = GetOrRegisterGauge("vmem/shared", DefaultRegistry)
|
vmemShared = GetOrRegisterGauge("vmem/shared", DefaultRegistry)
|
||||||
vmemMapped = GetOrRegisterGauge("vmem/mapped", DefaultRegistry)
|
vmemMapped = GetOrRegisterGauge("vmem/mapped", DefaultRegistry)
|
||||||
|
vmemSwapped = GetOrRegisterGauge("vmem/swapped", DefaultRegistry)
|
||||||
|
vmemVmallocUsed = GetOrRegisterGauge("vmem/vmalloc/used", DefaultRegistry)
|
||||||
|
vmemVmallocChunk = GetOrRegisterGauge("vmem/vmalloc/chunk", DefaultRegistry)
|
||||||
)
|
)
|
||||||
|
|
||||||
p, _ := process.NewProcess(int32(os.Getpid()))
|
p, _ := process.NewProcess(int32(os.Getpid()))
|
||||||
@ -177,23 +180,9 @@ func CollectProcessMetrics(refresh time.Duration) {
|
|||||||
vmemDirty.Update(int64(m.Dirty))
|
vmemDirty.Update(int64(m.Dirty))
|
||||||
vmemShared.Update(int64(m.Shared))
|
vmemShared.Update(int64(m.Shared))
|
||||||
vmemMapped.Update(int64(m.Mapped))
|
vmemMapped.Update(int64(m.Mapped))
|
||||||
|
vmemSwapped.Update(int64(m.SwapCached))
|
||||||
//Slab uint64 `json:"slab"`
|
vmemVmallocUsed.Update(int64(m.VmallocUsed))
|
||||||
//Sreclaimable uint64 `json:"sreclaimable"`
|
vmemVmallocChunk.Update(int64(m.VmallocChunk))
|
||||||
//Sunreclaim uint64 `json:"sunreclaim"`
|
|
||||||
//PageTables uint64 `json:"pageTables"`
|
|
||||||
//SwapCached uint64 `json:"swapCached"`
|
|
||||||
//CommitLimit uint64 `json:"commitLimit"`
|
|
||||||
//CommittedAS uint64 `json:"committedAS"`
|
|
||||||
//HighTotal uint64 `json:"highTotal"`
|
|
||||||
//HighFree uint64 `json:"highFree"`
|
|
||||||
//LowTotal uint64 `json:"lowTotal"`
|
|
||||||
//LowFree uint64 `json:"lowFree"`
|
|
||||||
//SwapTotal uint64 `json:"swapTotal"`
|
|
||||||
//SwapFree uint64 `json:"swapFree"`
|
|
||||||
//VmallocTotal uint64 `json:"vmallocTotal"`
|
|
||||||
//VmallocUsed uint64 `json:"vmallocUsed"`
|
|
||||||
//VmallocChunk uint64 `json:"vmallocChunk"`
|
|
||||||
}
|
}
|
||||||
if m, _ := p.MemoryInfo(); m != nil {
|
if m, _ := p.MemoryInfo(); m != nil {
|
||||||
memRSS.Update(int64(m.RSS))
|
memRSS.Update(int64(m.RSS))
|
||||||
|
Loading…
Reference in New Issue
Block a user