machine

package
v1.0.129 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: GPL-3.0 Imports: 9 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

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 {
	// contains filtered or unexported fields
}

MemStatistics can compute the mem usage percent and other mem statistics

func (*MemStatistics) ComputeStatistics

func (ms *MemStatistics) ComputeStatistics()

ComputeStatistics computes the current memory usage.

func (*MemStatistics) MemPercentUsage

func (ms *MemStatistics) MemPercentUsage() uint64

MemPercentUsage will return the memory percent usage. Concurrent safe.

func (*MemStatistics) MemoryUsedByGolang

func (ms *MemStatistics) MemoryUsedByGolang() uint64

MemoryUsedByGolang will return the total memory used by the node in bytes. Concurrent safe

func (*MemStatistics) MemoryUsedBySystem

func (ms *MemStatistics) MemoryUsedBySystem() uint64

MemoryUsedBySystem will return the total memory used by the system in bytes. Concurrent safe

func (*MemStatistics) TotalMemory

func (ms *MemStatistics) TotalMemory() uint64

TotalMemory will return the total memory available in bytes. Concurrent safe.

type NetStatistics

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

NetStatistics can compute the network statistics

func (*NetStatistics) BpsRecv

func (ns *NetStatistics) BpsRecv() uint64

BpsRecv bytes received per second on all interfaces

func (*NetStatistics) BpsRecvPeak

func (ns *NetStatistics) BpsRecvPeak() uint64

BpsRecvPeak peak bytes received per second on all interfaces

func (*NetStatistics) BpsSent

func (ns *NetStatistics) BpsSent() uint64

BpsSent bytes sent per second on all interfaces

func (*NetStatistics) BpsSentPeak

func (ns *NetStatistics) BpsSentPeak() uint64

BpsSentPeak peak bytes sent per second on all interfaces

func (*NetStatistics) ComputeStatistics

func (ns *NetStatistics) ComputeStatistics()

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

func (*NetStatistics) PercentRecv

func (ns *NetStatistics) PercentRecv() uint64

PercentRecv BpsRecv / BpsRecvPeak * 100

func (*NetStatistics) PercentSent

func (ns *NetStatistics) PercentSent() uint64

PercentSent BpsSent / BpsSentPeak * 100

Jump to

Keyboard shortcuts

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