procstats

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartCollector

func StartCollector(collector Collector) io.Closer

func StartCollectorWith

func StartCollectorWith(config Config) io.Closer

Types

type CPUInfo

type CPUInfo struct {
	User time.Duration // user cpu time used by the process
	Sys  time.Duration // system cpu time used by the process
}

type Collector

type Collector interface {
	Collect()
}

func MultiCollector

func MultiCollector(collectors ...Collector) Collector

type CollectorFunc

type CollectorFunc func()

func (CollectorFunc) Collect

func (f CollectorFunc) Collect()

type Config

type Config struct {
	Collector       Collector
	CollectInterval time.Duration
}

type DelayInfo

type DelayInfo struct {
	CPUDelay       time.Duration
	BlockIODelay   time.Duration
	SwapInDelay    time.Duration
	FreePagesDelay time.Duration
}

func CollectDelayInfo

func CollectDelayInfo(pid int) (DelayInfo, error)

type DelayMetrics

type DelayMetrics struct {
	CPUDelay       time.Duration `metric:"cpu.delay.seconds" type:"counter"`
	BlockIODelay   time.Duration `metric:"blockio.delay.seconds" type:"counter"`
	SwapInDelay    time.Duration `metric:"swapin.delay.seconds" type:"counter"`
	FreePagesDelay time.Duration `metric:"freepages.delay.seconds" type:"counter"`
	// contains filtered or unexported fields
}

DelayMetrics is a metric collector that reports resource delays on processes.

func NewDelayMetrics

func NewDelayMetrics() *DelayMetrics

NewDelayStats collects metrics on the current process and reports them to the default stats engine.

func NewDelayMetricsWith

func NewDelayMetricsWith(eng *stats.Engine, pid int) *DelayMetrics

NewDelayStatsWith collects metrics on the process identified by pid and reports them to eng.

func (*DelayMetrics) Collect

func (d *DelayMetrics) Collect()

Collect satisfies the Collector interface.

type FileInfo

type FileInfo struct {
	Open uint64 // fds opened by the process
	Max  uint64 // max number of fds the process can open
}

type GoMetrics

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

GoMetrics is a metric collector that reports metrics from the Go runtime.

func NewGoMetrics

func NewGoMetrics() *GoMetrics

NewGoMetrics creates a new collector for the Go runtime that produces metrics on the default stats engine.

func NewGoMetricsWith

func NewGoMetricsWith(eng *stats.Engine) *GoMetrics

NewGoMetricsWith creates a new collector for the Go unrtime that producers metrics on eng.

func (*GoMetrics) Collect

func (g *GoMetrics) Collect()

Collect satisfies the Collector interface.

type MemoryInfo

type MemoryInfo struct {
	Available uint64 // amound of RAM available to the process
	Size      uint64 // total program memory (including virtual mappings)
	Resident  uint64 // resident set size
	Shared    uint64 // shared pages (i.e., backed by a file)
	Text      uint64 // text (code)
	Data      uint64 // data + stack

	MajorPageFaults uint64
	MinorPageFaults uint64
}

type ProcInfo

type ProcInfo struct {
	CPU     CPUInfo
	Memory  MemoryInfo
	Files   FileInfo
	Threads ThreadInfo
}

func CollectProcInfo

func CollectProcInfo(pid int) (ProcInfo, error)

type ProcMetrics

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

ProcMetrics is a metric collector that reports metrics on processes.

func NewProcMetrics

func NewProcMetrics() *ProcMetrics

NewProdMetrics collects metrics on the current process and reports them to the default stats engine.

func NewProcMetricsWith

func NewProcMetricsWith(eng *stats.Engine, pid int) *ProcMetrics

NewProcMetricsWith collects metrics on the process identified by pid and reports them to eng.

func (*ProcMetrics) Collect

func (p *ProcMetrics) Collect()

Collect satsifies the Collector interface.

type ThreadInfo

type ThreadInfo struct {
	Num                        uint64
	VoluntaryContextSwitches   uint64
	InvoluntaryContextSwitches uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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