deviceinfo

package
v0.0.0-...-194264a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

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

func GetFSInfo(path string) (total, available int)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL