collector

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCollector

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

BaseCollector provides common functionality for all collectors

func NewBaseCollector

func NewBaseCollector(name string, enabled bool) *BaseCollector

NewBaseCollector creates a new base collector

func (*BaseCollector) Enabled

func (b *BaseCollector) Enabled() bool

Enabled returns whether the collector is enabled

func (*BaseCollector) Name

func (b *BaseCollector) Name() string

Name returns the collector name

type CPUCollector

type CPUCollector struct {
	*BaseCollector
}

CPUCollector collects CPU metrics

func NewCPUCollector

func NewCPUCollector(enabled bool) *CPUCollector

NewCPUCollector creates a new CPU collector

func (*CPUCollector) Collect

func (c *CPUCollector) Collect(ctx context.Context) (interface{}, error)

Collect collects CPU metrics

type Collector

type Collector interface {
	// Collect collects metrics and returns them
	Collect(ctx context.Context) (interface{}, error)

	// Name returns the name of this collector
	Name() string

	// Enabled returns whether this collector is enabled
	Enabled() bool
}

Collector is the interface that all metric collectors must implement

type DiskCollector

type DiskCollector struct {
	*BaseCollector
}

DiskCollector collects disk metrics

func NewDiskCollector

func NewDiskCollector(enabled bool) *DiskCollector

NewDiskCollector creates a new disk collector

func (*DiskCollector) Collect

func (d *DiskCollector) Collect(ctx context.Context) (interface{}, error)

Collect collects disk metrics

type MemoryCollector

type MemoryCollector struct {
	*BaseCollector
}

MemoryCollector collects memory metrics

func NewMemoryCollector

func NewMemoryCollector(enabled bool) *MemoryCollector

NewMemoryCollector creates a new memory collector

func (*MemoryCollector) Collect

func (m *MemoryCollector) Collect(ctx context.Context) (interface{}, error)

Collect collects memory metrics

type NetworkCollector

type NetworkCollector struct {
	*BaseCollector
}

NetworkCollector collects network metrics

func NewNetworkCollector

func NewNetworkCollector(enabled bool) *NetworkCollector

NewNetworkCollector creates a new network collector

func (*NetworkCollector) Collect

func (n *NetworkCollector) Collect(ctx context.Context) (interface{}, error)

Collect collects network metrics

type SystemCollector

type SystemCollector struct {
	*BaseCollector
	// contains filtered or unexported fields
}

SystemCollector collects system metrics

func NewSystemCollector

func NewSystemCollector(enabled bool) *SystemCollector

NewSystemCollector creates a new system collector

func (*SystemCollector) Collect

func (s *SystemCollector) Collect(ctx context.Context) (interface{}, error)

Collect collects system metrics (deprecated - use CollectStatic and CollectDynamic)

func (*SystemCollector) CollectDynamic

func (s *SystemCollector) CollectDynamic(ctx context.Context) (*models.SystemDynamic, error)

CollectDynamic collects dynamic system metrics

func (*SystemCollector) CollectStatic

func (s *SystemCollector) CollectStatic(ctx context.Context) (*models.StaticMetrics, error)

CollectStatic collects static system information (cached)

Jump to

Keyboard shortcuts

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