erigon-pulse/common/experiments.go
2022-10-11 11:25:08 +07:00

23 lines
284 B
Go

package common
import (
"os"
"runtime"
)
var doMemstat = true
func init() {
_, ok := os.LookupEnv("NO_MEMSTAT")
if ok {
doMemstat = false
}
}
func DoMemStat() bool { return doMemstat }
func ReadMemStats(m *runtime.MemStats) {
if doMemstat {
runtime.ReadMemStats(m)
}
}