system

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExecCommand = exec.Command

Functions

This section is empty.

Types

type PID

type PID int32

func ParseOutput

func ParseOutput(out string) ([]PID, error)

type PIDFinder

type PIDFinder interface {
	PidFile(path string) ([]PID, error)
	Pattern(pattern string) ([]PID, error)
	Uid(user string) ([]PID, error)
	FullPattern(path string) ([]PID, error)
}

func NewPgrep

func NewPgrep() (PIDFinder, error)

type Pgrep

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

Implemention of PIDGatherer that execs pgrep to find processes

func (*Pgrep) FullPattern

func (pg *Pgrep) FullPattern(pattern string) ([]PID, error)

func (*Pgrep) Pattern

func (pg *Pgrep) Pattern(pattern string) ([]PID, error)

func (*Pgrep) PidFile

func (pg *Pgrep) PidFile(path string) ([]PID, error)

func (*Pgrep) Uid

func (pg *Pgrep) Uid(user string) ([]PID, error)

type Proc

type Proc struct {
	*process.Process
	// contains filtered or unexported fields
}

func (*Proc) PID

func (p *Proc) PID() PID

func (*Proc) Percent

func (p *Proc) Percent(interval time.Duration) (float64, error)

func (*Proc) Tags

func (p *Proc) Tags() map[string]string

type Process

type Process interface {
	PID() PID
	Tags() map[string]string

	IOCounters() (*process.IOCountersStat, error)
	MemoryInfo() (*process.MemoryInfoStat, error)
	Name() (string, error)
	NumCtxSwitches() (*process.NumCtxSwitchesStat, error)
	NumFDs() (int32, error)
	NumThreads() (int32, error)
	Percent(interval time.Duration) (float64, error)
	Times() (*cpu.TimesStat, error)
	RlimitUsage(bool) ([]process.RlimitStat, error)
}

func NewProc

func NewProc(pid PID) (Process, error)

Jump to

Keyboard shortcuts

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