improved logging; updated deps

This commit is contained in:
2022-12-22 19:52:26 +01:00
parent 4570c2b3f6
commit ba9636cffd
4 changed files with 35 additions and 21 deletions

View File

@@ -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)
}