process

package
v0.0.0-...-9e6775c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAllProcs

func InitAllProcs() (map[int32]*Process, error)

InitAllProcs initialises the set of currently running processes in the system.

Types

type Process

type Process struct {
	Proc           *proc.Process
	MemoryInfo     *proc.MemoryInfoStat
	PageFault      *proc.PageFaultsStat
	NumCtxSwitches *proc.NumCtxSwitchesStat
	Exe            string
	Name           string
	Status         string
	Children       []*proc.Process
	Gids           []int32
	CPUAffinity    []int32
	CreateTime     int64
	CPUPercent     float64
	Nice           int32
	NumThreads     int32
	MemoryPercent  float32
	IsRunning      bool
	Foreground     bool
	Background     bool
}

Process type contains as fields all the information extracted from the kernel.

func NewProcess

func NewProcess(pid int32) (*Process, error)

NewProcess return a Process variable for a given PID

func (*Process) UpdateProcInfo

func (p *Process) UpdateProcInfo()

UpdateProcInfo updates the fields for a process.

Jump to

Keyboard shortcuts

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