procs

package
v4.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Procs              = make(map[string]*models.ProcCollect)
	ProcsWithScheduler = make(map[string]*ProcScheduler)
)

Functions

func AddNewProcCollect

func AddNewProcCollect(newCollect map[string]*models.ProcCollect)

func DelNoProcCollect

func DelNoProcCollect(newCollect map[string]*models.ProcCollect)

func Detect

func Detect()

func ProcCollect

func ProcCollect(p *models.ProcCollect)

func ReadNameAndMem

func ReadNameAndMem(path string) (name string, memory uint64, err error)

Types

type Proc

type Proc struct {
	Pid     int
	Name    string
	Exe     string
	Cmdline string
	Mem     uint64
	Cpu     float64

	RBytes  uint64
	WBytes  uint64
	Uptime  uint64
	FdCount int
	// contains filtered or unexported fields
}

func AllProcs

func AllProcs() (ps []*Proc, err error)

func (*Proc) String

func (this *Proc) String() string

type ProcScheduler

type ProcScheduler struct {
	Ticker *time.Ticker
	Proc   *models.ProcCollect
	Quit   chan struct{}
}

func NewProcScheduler

func NewProcScheduler(p *models.ProcCollect) *ProcScheduler

func (*ProcScheduler) Schedule

func (p *ProcScheduler) Schedule()

func (*ProcScheduler) Stop

func (p *ProcScheduler) Stop()

Jump to

Keyboard shortcuts

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