process

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupGID

func LookupGID(gid string) (string, error)

func LookupUID

func LookupUID(uid string) (string, error)

Types

type Process

type Process struct {
	Pid     string
	Stat    proc.Stat
	Status  proc.Status
	CmdLine []string
	Label   string
	PidNS   string
	Huser   string
	Hgroup  string
}

func FromPIDs

func FromPIDs(pids []string, joinUserNS bool) ([]*Process, error)

FromPIDs creates a new Process for each pid.

func New

func New(pid string, joinUserNS bool) (*Process, error)

New returns a new Process with the specified pid and parses the relevant data from /proc and /dev.

func (*Process) CPUTime

func (p *Process) CPUTime() (time.Duration, error)

CPUTime returns the cumlative CPU time of process p as a time.Duration.

func (*Process) ElapsedTime

func (p *Process) ElapsedTime() (time.Duration, error)

ElapsedTime returns the time.Duration since process p was created.

func (*Process) SetHostData

func (p *Process) SetHostData() error

SetHostData sets all host-related data fields.

func (*Process) StartTime

func (p *Process) StartTime() (time.Time, error)

StarTime returns the time.Time when process p was started.

Jump to

Keyboard shortcuts

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