You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// +build linuxpackage memory
import"syscall"funcsysTotalMemory() uint64 {
in:=&syscall.Sysinfo_t{}
err:=syscall.Sysinfo(in)
iferr!=nil {
return0
}
// If this is a 32-bit system, then these fields are// uint32 instead of uint64.// So we always convert to uint64 to match signature.returnuint64(in.Totalram) *uint64(in.Unit)
}
should be sufficient for our usecase and removes one external dependency.
The text was updated successfully, but these errors were encountered:
We use this external dependency just for the sake of gathering CPUCount and Memory, for CPUCount there is:
runtime.NumCPU
and for Memory we can copy the work of https://github.com/pbnjay/memory which gathers memory with a syscall like:
should be sufficient for our usecase and removes one external dependency.
The text was updated successfully, but these errors were encountered: