process

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PID     = "pid"
	Comm    = "comm"
	PPID    = "ppid"
	Cmdline = "cmdline"
	Threads = "threads"
)

We use these keys in node metadata

Variables

View Source
var (
	ReadDir  = ioutil.ReadDir
	ReadFile = ioutil.ReadFile
)

Hooks exposed for mocking

Functions

This section is empty.

Types

type CachingWalker

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

CachingWalker is a walker than caches a copy of the output from another Walker, and then allows other concurrent readers to Walk that copy.

func NewCachingWalker

func NewCachingWalker(source Walker) *CachingWalker

NewCachingWalker returns a new CachingWalker

func (*CachingWalker) Tick added in v0.7.0

func (c *CachingWalker) Tick() error

Tick updates cached copy of process list

func (*CachingWalker) Walk

func (c *CachingWalker) Walk(f func(Process)) error

Walk walks a cached copy of process list

type Process

type Process struct {
	PID, PPID int
	Comm      string
	Cmdline   string
	Threads   int
}

Process represents a single process.

type Reporter

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

Reporter generates Reports containing the Process topology.

func NewReporter

func NewReporter(walker Walker, scope string) *Reporter

NewReporter makes a new Reporter.

func (*Reporter) Report

func (r *Reporter) Report() (report.Report, error)

Report implements Reporter.

type Tree

type Tree interface {
	GetParent(pid int) (int, error)
}

Tree represents all processes on the machine.

func NewTree

func NewTree(walker Walker) (Tree, error)

NewTree returns a new Tree that can be polled.

type Walker

type Walker interface {
	Walk(func(Process)) error
}

Walker is something that walks the /proc directory

func NewWalker

func NewWalker(procRoot string) Walker

NewWalker creates a new process Walker.

Jump to

Keyboard shortcuts

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