machine

package
v1.1.38 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentProcess

func GetCurrentProcess() (*process.Process, error)

GetCurrentProcess returns details about the current process

func NewNetStatistics added in v1.1.28

func NewNetStatistics() *netStatistics

NewNetStatistics returns a new instance of the netStatistics

Types

type CpuStatistics

type CpuStatistics struct {
	// contains filtered or unexported fields
}

CpuStatistics can compute the cpu usage percent

func NewCpuStatistics

func NewCpuStatistics() (*CpuStatistics, error)

NewCpuStatistics will create a CpuStatistics object

func (*CpuStatistics) ComputeStatistics

func (cs *CpuStatistics) ComputeStatistics()

ComputeStatistics computes the current cpu usage. It should be called on a go routine as it is a blocking call for a bounded time (1 second)

func (*CpuStatistics) CpuPercentUsage

func (cs *CpuStatistics) CpuPercentUsage() uint64

CpuPercentUsage will return the cpu percent usage. Concurrent safe.

type MemStatistics

type MemStatistics struct {
	Total        uint64
	PercentUsed  uint64
	UsedByGolang uint64
	UsedBySystem uint64
	HeapInUse    uint64
	StackInUse   uint64
}

MemStatistics holds memory statistics

func AcquireMemStatistics added in v1.0.136

func AcquireMemStatistics() MemStatistics

AcquireMemStatistics acquires memory statistics

func (*MemStatistics) String added in v1.0.136

func (stats *MemStatistics) String() string

Jump to

Keyboard shortcuts

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