sysinfo

package
v3.3.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDockerNotFound is returned if a Docker ID is not found in
	// /proc/self/cgroup
	ErrDockerNotFound = errors.New("Docker ID not found")
)
View Source
var (
	// ErrFeatureUnsupported indicates unsupported platform.
	ErrFeatureUnsupported = errors.New("That feature is not supported on this platform")
)

Functions

func BootID

func BootID() (string, error)

BootID returns the boot ID of the executing kernel.

func BytesToMebibytes

func BytesToMebibytes(bts uint64) uint64

BytesToMebibytes converts bytes into mebibytes.

func DockerID

func DockerID() (string, error)

DockerID attempts to detect Docker.

func Hostname

func Hostname() (string, error)

Hostname returns the host name.

func PhysicalMemoryBytes

func PhysicalMemoryBytes() (uint64, error)

PhysicalMemoryBytes returns the total amount of host memory.

Types

type Usage

type Usage struct {
	System time.Duration
	User   time.Duration
}

Usage contains process process times.

func GetUsage

func GetUsage() (Usage, error)

GetUsage gathers process times.

Jump to

Keyboard shortcuts

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