Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GPUMemory ¶
GPUMemory returns specified memory information in MiB unit
`typeOpt`: type of memory info. Can be "used", "total", "free". Default="total"
func UsedGPUMem ¶
func UsedGPUMem() float64
UsedGPUMem returns used-up GPU memory in MiB since last check. If error occurs, it will log to console and return -1.
Types ¶
type SI ¶
type SI struct {
Uptime time.Duration // time since boot
Loads [3]float64 // 1, 5, and 15 minute load averages, see e.g. UPTIME(1)
Procs uint64 // number of current processes
TotalRam uint64 // total usable main memory size [kB]
FreeRam uint64 // available memory size [kB]
BufferRam uint64 // memory used by buffers [kB]
TotalSwap uint64 // total swap space size [kB]
FreeSwap uint64 // swap space still available [kB]
TotalHighRam uint64 // total high memory size [kB]
FreeHighRam uint64 // available high memory size [kB]
// contains filtered or unexported fields
}
Go-ized http://man7.org/linux/man-pages/man2/sysinfo.2.html
func CPUInfo ¶
func CPUInfo() *SI
Get the linux sysinfo data structure.
Useful links in the wild web: http://man7.org/linux/man-pages/man2/sysinfo.2.html http://man7.org/linux/man-pages/man1/uptime.1.html https://github.com/capnm/golang/blob/go1.1.1/src/pkg/syscall/zsyscall_linux_amd64.go#L1050 https://github.com/capnm/golang/blob/go1.1.1/src/pkg/syscall/ztypes_linux_amd64.go#L528 https://github.com/capnm/golang/blob/go1.1.1/src/pkg/syscall/ztypes_linux_arm.go#L502