procfs

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proc

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

Proc represents the process for which we want to find stats

func New

func New(pid int32, samplingInterval time.Duration, usePss bool) (*Proc, error)

New returns new Proc struct

func (*Proc) GetStats

func (ps *Proc) GetStats() (stat *Stats, err error)

GetStats returns process stats

func (*Proc) GetStatsInInterval

func (ps *Proc) GetStatsInInterval() []*Stats

GetStatsInInterval returns process stats after every interval

func (*Proc) GetStatsInIntervalWithContext

func (ps *Proc) GetStatsInIntervalWithContext(ctx context.Context) []*Stats

GetStatsInIntervalWithContext returns process stats after every interval

type Stats

type Stats struct {
	CPUPercentage float64
	MemPercentage float64
	MemShared     uint64
	MemSwapped    uint64
	MemConsumed   uint64
	RecordTime    time.Time
}

Stats represents the process stats

Jump to

Keyboard shortcuts

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