Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAvailableMem ¶
GetAvailableMem retrieves available memory in kilobytes from /proc/meminfo.
func GetBatterySOC ¶
GetBatterySOC retrieves the State of Charge (SOC) of the battery as a percentage.
func GetBatterySOH ¶
GetBatterySOH retrieves the State of Health (SOH) of the battery as a percentage.
SOH is calculated as the ratio of the battery's current maximum energy capacity as a percentage of its original design capacity.
func GetCPULoad ¶
GetCPULoad calculates the current CPU load percentage by reading data from the /proc/stat file.
func GetMemUsage ¶
GetMemUsage calculates the current memory usage in percent.
func GetTotalMem ¶
GetTotalMem retrieves total memory in kilobytes from /proc/meminfo.
Types ¶
type StorageUsage ¶
StorageUsage represents disk storage metrics. Fields:
- TotalGB (float64): The total storage capacity in gigabytes.
- FreeGB (float64): The available storage in gigabytes for non-root users.
- UsedGB (float64): The amount of used storage in gigabytes.
- UsedPercent (float64): The percentage of storage in use.
func GetDiskUsage ¶
func GetDiskUsage(path string) (StorageUsage, error)
GetDiskUsage retrieves disk usage statistics for a given file system path.