Documentation ¶
Overview ¶
Package deviceinfo contains some utility functions that return information about the underlying device on which the package runs, e.g., how many CPUs it has, how much RAM it has, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFSInfo ¶
GetFSInfo returns the total size and the amount of available space of the drive on which the specified path is located. The sizes returned are in MiBs. A return value of -1 indicates an error.
func GetLoadAvg ¶
func GetLoadAvg() int
GetLoadAvg returns the average load of the device. -1 is returned if an error occurred.
func GetMemoryInfo ¶
func GetMemoryInfo() (total, available int)
GetMemoryInfo returns the both the total amount of memory installed in the device and the amount of memory currently available, in MiB. A return value of -1 indicates that an error occurred computing the return value.
func GetOnlineCPUs ¶
func GetOnlineCPUs() int
GetOnlineCPUs returns the number of CPUS in the device. A return value of -1 indicates that an error has occurred.
Types ¶
This section is empty.