system

package
v0.0.0-...-ffd72ff Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDiskUsage

type MockDiskUsage struct {
	*mock.Mock
}

func (*MockDiskUsage) OSGetenv

func (m *MockDiskUsage) OSGetenv(key string) string

func (*MockDiskUsage) OSStat

func (m *MockDiskUsage) OSStat(name string) (os.FileInfo, error)

func (*MockDiskUsage) PSDiskUsage

func (m *MockDiskUsage) PSDiskUsage(path string) (*disk.UsageStat, error)

func (*MockDiskUsage) Partitions

func (m *MockDiskUsage) Partitions(all bool) ([]disk.PartitionStat, error)

type MockPS

type MockPS struct {
	mock.Mock
	PSDiskDeps
}

func (*MockPS) CPUTimes

func (m *MockPS) CPUTimes(_, _ bool) ([]cpu.TimesStat, error)

func (*MockPS) DiskIO

func (m *MockPS) DiskIO(_ []string) (map[string]disk.IOCountersStat, error)

func (*MockPS) DiskUsage

func (m *MockPS) DiskUsage(mountPointFilter []string, fstypeExclude []string) ([]*disk.UsageStat, []*disk.PartitionStat, error)

func (*MockPS) LoadAvg

func (m *MockPS) LoadAvg() (*load.AvgStat, error)

func (*MockPS) NetConnections

func (m *MockPS) NetConnections() ([]net.ConnectionStat, error)

func (*MockPS) NetIO

func (m *MockPS) NetIO() ([]net.IOCountersStat, error)

func (*MockPS) NetProto

func (m *MockPS) NetProto() ([]net.ProtoCountersStat, error)

func (*MockPS) SwapStat

func (m *MockPS) SwapStat() (*mem.SwapMemoryStat, error)

func (*MockPS) Temperature

func (m *MockPS) Temperature() ([]host.TemperatureStat, error)

func (*MockPS) VMStat

func (m *MockPS) VMStat() (*mem.VirtualMemoryStat, error)

type MockPSDisk

type MockPSDisk struct {
	*SystemPS
	*mock.Mock
}

type PS

type PS interface {
	CPUTimes(perCPU, totalCPU bool) ([]cpu.TimesStat, error)
	DiskUsage(mountPointFilter []string, fstypeExclude []string) ([]*disk.UsageStat, []*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
	Log telegraf.Logger `toml:"-"`
}

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,
) ([]*disk.UsageStat, []*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 {
	Log telegraf.Logger
}

func (*SystemStats) Description

func (*SystemStats) Description() string

func (*SystemStats) Gather

func (s *SystemStats) Gather(acc telegraf.Accumulator) error

func (*SystemStats) SampleConfig

func (*SystemStats) SampleConfig() string

Jump to

Keyboard shortcuts

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