process

package
v1.77.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ID = os.Getpid()

ID - self process id

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	// CPU usage total: 0.5 = 50% of core, 2.0 = 100% of two core
	CPU float64
	// RMemory - redident memory usage in bytes
	RMemory uint64
	// VMemory - virtual memory usage in bytes
	VMemory uint64
	// contains filtered or unexported fields
}

Monitor process stats

func StartMonitor

func StartMonitor(pid int, refreshInterval time.Duration) (*Monitor, error)

StartMonitor process - self process on pid == 0

func (*Monitor) PID

func (pm *Monitor) PID() int

PID - process id

func (*Monitor) Stop

func (pm *Monitor) Stop()

Stop refresh stats

func (*Monitor) Tick

func (pm *Monitor) Tick(t time.Time)

Tick of collection stats

Jump to

Keyboard shortcuts

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