system

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 13 Imported by: 0

README

system

系统负载相关的采集插件

监控大盘和告警规则

该 README 文件所在的同级目录下有监控大盘和告警规则的配置JSON文件,导入夜莺即可使用

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskUsageStat

type DiskUsageStat struct {
	*disk.UsageStat
	DeviceError int
}

type PS

type PS interface {
	CPUTimes(perCPU, totalCPU bool) ([]cpu.TimesStat, error)
	DiskUsage(mountPointFilter []string, fstypeExclude []string) ([]*DiskUsageStat, []*disk.PartitionStat, error)
	NetIO() ([]net.IOCountersStat, error)
	NetProto() ([]net.ProtoCountersStat, error)
	DiskIO(names []string) (map[string]disk.IOCountersStat, error)
	VMStat() (*mem.VirtualMemoryStat, error)
	SwapStat() (*mem.SwapMemoryStat, error)
	NetConnections() ([]net.ConnectionStat, error)
	Temperature() ([]host.TemperatureStat, error)
}

type PSDiskDeps

type PSDiskDeps interface {
	Partitions(all bool) ([]disk.PartitionStat, error)
	OSGetenv(key string) string
	OSStat(name string) (os.FileInfo, error)
	PSDiskUsage(path string) (*disk.UsageStat, error)
}

type SystemPS

type SystemPS struct {
	PSDiskDeps
}

func NewSystemPS

func NewSystemPS() *SystemPS

func (*SystemPS) CPUTimes

func (s *SystemPS) CPUTimes(perCPU, totalCPU bool) ([]cpu.TimesStat, error)

func (*SystemPS) DiskIO

func (s *SystemPS) DiskIO(names []string) (map[string]disk.IOCountersStat, error)

func (*SystemPS) DiskUsage

func (s *SystemPS) DiskUsage(
	mountPointFilter []string,
	fstypeExclude []string,
) ([]*DiskUsageStat, []*disk.PartitionStat, error)

func (*SystemPS) NetConnections

func (s *SystemPS) NetConnections() ([]net.ConnectionStat, error)

func (*SystemPS) NetIO

func (s *SystemPS) NetIO() ([]net.IOCountersStat, error)

func (*SystemPS) NetProto

func (s *SystemPS) NetProto() ([]net.ProtoCountersStat, error)

func (*SystemPS) SwapStat

func (s *SystemPS) SwapStat() (*mem.SwapMemoryStat, error)

func (*SystemPS) Temperature

func (s *SystemPS) Temperature() ([]host.TemperatureStat, error)

func (*SystemPS) VMStat

func (s *SystemPS) VMStat() (*mem.VirtualMemoryStat, error)

type SystemPSDisk

type SystemPSDisk struct{}

func (*SystemPSDisk) OSGetenv

func (s *SystemPSDisk) OSGetenv(key string) string

func (*SystemPSDisk) OSStat

func (s *SystemPSDisk) OSStat(name string) (os.FileInfo, error)

func (*SystemPSDisk) PSDiskUsage

func (s *SystemPSDisk) PSDiskUsage(path string) (*disk.UsageStat, error)

func (*SystemPSDisk) Partitions

func (s *SystemPSDisk) Partitions(all bool) ([]disk.PartitionStat, error)

type SystemStats

type SystemStats struct {
	config.PluginConfig
	CollectUserNumber bool `toml:"collect_user_number"`
}

func (*SystemStats) Clone

func (s *SystemStats) Clone() inputs.Input

func (*SystemStats) Gather

func (s *SystemStats) Gather(slist *types.SampleList)

func (*SystemStats) Name

func (s *SystemStats) Name() string

Jump to

Keyboard shortcuts

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