process

package
v0.0.0-...-476c5b3 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 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)

LookupGID returns the textual group ID, if it can be optained, or the decimal representation otherwise.

func LookupUID

func LookupUID(uid string) (string, error)

LookupUID return the textual user ID, if it can be optained, or the decimal representation otherwise.

Types

type Process

type Process struct {
	// PID is the process ID.
	Pid string
	// Stat contains data from /proc/$pid/stat.
	Stat proc.Stat
	// Status containes data from /proc/$pid/status.
	Status proc.Status
	// CmdLine containes data from /proc/$pid/cmdline.
	CmdLine []string
	// Label containers data from /proc/$pid/attr/current.
	Label string
	// PidNS contains data from /proc/$pid/ns/pid.
	PidNS string
	// Huser is the effective host user of a container process.
	Huser string
	// Hgroup is the effective host group of a container process.
	Hgroup string
}

Process includes process-related from the /proc FS.

func FromPIDs

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

FromPIDs creates a new Process for each pid.

func New

func New(pid string) (*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.

Jump to

Keyboard shortcuts

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