collector

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUCollector

type CPUCollector struct{}

CPUCollector collects CPU usage metrics.

func NewCPUCollector

func NewCPUCollector() *CPUCollector

NewCPUCollector returns a new CPUCollector instance.

func (*CPUCollector) Collect

func (c *CPUCollector) Collect() (interface{}, error)

Collect retrieves CPU usage percentages. It waits for one second to sample CPU usage.

type Collector

type Collector interface {
	Collect() (interface{}, error)
}

type MemoryCollector

type MemoryCollector struct{}

MemoryCollector gathers memory usage metrics.

func NewMemoryCollector

func NewMemoryCollector() *MemoryCollector

NewMemoryCollector creates a new MemoryCollector.

func (*MemoryCollector) Collect

func (m *MemoryCollector) Collect() (interface{}, error)

Collect retrieves virtual memory statistics.

type Spy

type Spy struct{}

Spy collects information about running processes.

func NewSpy

func NewSpy() *Spy

NewSpy returns a new Spy instance.

func (*Spy) Collect

func (s *Spy) Collect() (interface{}, error)

Collect retrieves process details.

type SystemStatsCollector

type SystemStatsCollector struct{}

SystemStatsCollector collects detailed system stats.

func NewSystemStatsCollector

func NewSystemStatsCollector() *SystemStatsCollector

NewSystemStatsCollector returns a new instance.

func (*SystemStatsCollector) Collect

func (s *SystemStatsCollector) Collect() (interface{}, error)

Collect gathers system statistics and returns a map.

Jump to

Keyboard shortcuts

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