probe

package
v0.0.0-...-4bf4393 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

type Probe interface {
	Init(config *ProbeConfig) error
	GetContext() (*ProbeContext, error)
}
var GProbe Probe = newProbe()

type ProbeConfig

type ProbeConfig struct {
	SamplingInterval uint64

	IO struct {
		NIC struct {
			Switch     bool
			Interfaces []string
		}
	}
	FileSystem struct {
		MountInfo struct {
			Switch        bool
			MountPoints   []string
			MountPointSet map[string]bool
		}
		FileInfo struct {
			Switch   bool
			FilePath []string
		}
	}
	Process struct {
		Switch      bool
		ProcName    []string
		ProcNameSet map[string]bool
	}
}
var GConfig *ProbeConfig

func (*ProbeConfig) Check

func (pc *ProbeConfig) Check() error

func (*ProbeConfig) Load

func (pc *ProbeConfig) Load(path string) error

type ProbeContext

type ProbeContext struct {
	SamplingCounter uint64

	Uptime     *psss.Uptime
	SystemStat *psss.SystemStat
	MemoryInfo *psss.MemoryInfo
	NetDevs    psss.NetDevs
	MountInfo  map[string]*extMountInfo
	FileInfo   []*psss.FileInfo
	ProcInfo   map[string]map[int]*psss.ProcInfo
}

func NewProbeContext

func NewProbeContext() *ProbeContext

func (*ProbeContext) Average

func (pc *ProbeContext) Average()

func (*ProbeContext) Fit

func (pc *ProbeContext) Fit(new *ProbeContext)

func (*ProbeContext) FitDiskStat

func (pc *ProbeContext) FitDiskStat(new *ProbeContext)

func (*ProbeContext) FitMemoryInfo

func (pc *ProbeContext) FitMemoryInfo(new *ProbeContext)

func (*ProbeContext) FitNetDevs

func (pc *ProbeContext) FitNetDevs(new *ProbeContext)

func (*ProbeContext) FitProcInfo

func (pc *ProbeContext) FitProcInfo(new *ProbeContext)

func (*ProbeContext) FitSystemStat

func (pc *ProbeContext) FitSystemStat(new *ProbeContext)

func (*ProbeContext) GetFileInfo

func (pc *ProbeContext) GetFileInfo() error

func (*ProbeContext) GetMemoryInfo

func (pc *ProbeContext) GetMemoryInfo() error

func (*ProbeContext) GetMountInfo

func (pc *ProbeContext) GetMountInfo() error

func (*ProbeContext) GetNetDevs

func (pc *ProbeContext) GetNetDevs() error

func (*ProbeContext) GetSystemStat

func (pc *ProbeContext) GetSystemStat() error

func (*ProbeContext) GetSystemUptime

func (pc *ProbeContext) GetSystemUptime() error

func (*ProbeContext) Sample

func (pc *ProbeContext) Sample() error

Jump to

Keyboard shortcuts

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