improved logging; updated deps
This commit is contained in:
11
utils.go
11
utils.go
@@ -24,6 +24,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -1008,3 +1009,13 @@ func (globs Globs) Expand() ([]string, error) {
|
||||
|
||||
return matches, nil
|
||||
}
|
||||
|
||||
func TotalMemory() uint64 {
|
||||
sinfo := new(syscall.Sysinfo_t)
|
||||
err := syscall.Sysinfo(sinfo)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return sinfo.Totalram * uint64(sinfo.Unit)
|
||||
}
|
||||
|
Reference in New Issue
Block a user