utils

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExecCommand = exec.Command

Functions

func ProtoCounters added in v1.5.4

func ProtoCounters(protocols []string) ([]net.ProtoCountersStat, error)

ProtoCounters wrapper

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