mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
less metrics performance impact
This commit is contained in:
parent
5ae602e9a4
commit
061dc51883
@ -67,11 +67,11 @@ func CollectProcessMetrics(refresh time.Duration) {
|
|||||||
|
|
||||||
// Create the various data collectors
|
// Create the various data collectors
|
||||||
cpuStats := make([]*CPUStats, 2)
|
cpuStats := make([]*CPUStats, 2)
|
||||||
memstats := make([]*runtime.MemStats, 2)
|
//memstats := make([]*runtime.MemStats, 2)
|
||||||
diskstats := make([]*DiskStats, 2)
|
diskstats := make([]*DiskStats, 2)
|
||||||
for i := 0; i < len(memstats); i++ {
|
for i := 0; i < len(cpuStats); i++ {
|
||||||
cpuStats[i] = new(CPUStats)
|
cpuStats[i] = new(CPUStats)
|
||||||
memstats[i] = new(runtime.MemStats)
|
//memstats[i] = new(runtime.MemStats)
|
||||||
diskstats[i] = new(DiskStats)
|
diskstats[i] = new(DiskStats)
|
||||||
}
|
}
|
||||||
// Define the various metrics to collect
|
// Define the various metrics to collect
|
||||||
@ -81,11 +81,12 @@ func CollectProcessMetrics(refresh time.Duration) {
|
|||||||
cpuThreads = GetOrRegisterGauge("system/cpu/threads", DefaultRegistry)
|
cpuThreads = GetOrRegisterGauge("system/cpu/threads", DefaultRegistry)
|
||||||
cpuGoroutines = GetOrRegisterGauge("system/cpu/goroutines", DefaultRegistry)
|
cpuGoroutines = GetOrRegisterGauge("system/cpu/goroutines", DefaultRegistry)
|
||||||
|
|
||||||
memPauses = GetOrRegisterMeter("system/memory/pauses", DefaultRegistry)
|
// disabled because of performance impact and because this info exists in logs
|
||||||
memAllocs = GetOrRegisterMeter("system/memory/allocs", DefaultRegistry)
|
//memPauses = GetOrRegisterMeter("system/memory/pauses", DefaultRegistry)
|
||||||
memFrees = GetOrRegisterMeter("system/memory/frees", DefaultRegistry)
|
//memAllocs = GetOrRegisterMeter("system/memory/allocs", DefaultRegistry)
|
||||||
memHeld = GetOrRegisterGauge("system/memory/held", DefaultRegistry)
|
//memFrees = GetOrRegisterMeter("system/memory/frees", DefaultRegistry)
|
||||||
memUsed = GetOrRegisterGauge("system/memory/used", DefaultRegistry)
|
//memHeld = GetOrRegisterGauge("system/memory/held", DefaultRegistry)
|
||||||
|
//memUsed = GetOrRegisterGauge("system/memory/used", DefaultRegistry)
|
||||||
|
|
||||||
diskReadBytes = GetOrRegisterMeter("system/disk/readbytes", DefaultRegistry)
|
diskReadBytes = GetOrRegisterMeter("system/disk/readbytes", DefaultRegistry)
|
||||||
diskWriteBytes = GetOrRegisterMeter("system/disk/writebytes", DefaultRegistry)
|
diskWriteBytes = GetOrRegisterMeter("system/disk/writebytes", DefaultRegistry)
|
||||||
@ -186,13 +187,13 @@ func CollectProcessMetrics(refresh time.Duration) {
|
|||||||
ruMajflt.Update(int64(pf.MajorFaults))
|
ruMajflt.Update(int64(pf.MajorFaults))
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.ReadMemStats(memstats[location1])
|
//runtime.ReadMemStats(memstats[location1])
|
||||||
memPauses.Mark(int64(memstats[location1].PauseTotalNs - memstats[location2].PauseTotalNs))
|
//memPauses.Mark(int64(memstats[location1].PauseTotalNs - memstats[location2].PauseTotalNs))
|
||||||
memAllocs.Mark(int64(memstats[location1].Mallocs - memstats[location2].Mallocs))
|
//memAllocs.Mark(int64(memstats[location1].Mallocs - memstats[location2].Mallocs))
|
||||||
memFrees.Mark(int64(memstats[location1].Frees - memstats[location2].Frees))
|
//memFrees.Mark(int64(memstats[location1].Frees - memstats[location2].Frees))
|
||||||
memHeld.Update(int64(memstats[location1].HeapSys - memstats[location1].HeapReleased))
|
//memHeld.Update(int64(memstats[location1].HeapSys - memstats[location1].HeapReleased))
|
||||||
memUsed.Update(int64(memstats[location1].Alloc))
|
//memUsed.Update(int64(memstats[location1].Alloc))
|
||||||
|
//
|
||||||
if io, _ := p.IOCounters(); io != nil {
|
if io, _ := p.IOCounters(); io != nil {
|
||||||
diskstats[location1].ReadBytes = int64(io.ReadBytes)
|
diskstats[location1].ReadBytes = int64(io.ReadBytes)
|
||||||
diskstats[location1].WriteBytes = int64(io.WriteBytes)
|
diskstats[location1].WriteBytes = int64(io.WriteBytes)
|
||||||
|
Loading…
Reference in New Issue
Block a user