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
type CPUCollector ¶
type CPUCollector struct {
*BaseCollector
}
CPUCollector collects CPU metrics
func NewCPUCollector ¶
func NewCPUCollector(enabled bool) *CPUCollector
NewCPUCollector creates a new CPU collector
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
type MemoryCollector ¶
type MemoryCollector struct {
*BaseCollector
}
MemoryCollector collects memory metrics
func NewMemoryCollector ¶
func NewMemoryCollector(enabled bool) *MemoryCollector
NewMemoryCollector creates a new memory collector
type NetworkCollector ¶
type NetworkCollector struct {
*BaseCollector
}
NetworkCollector collects network metrics
func NewNetworkCollector ¶
func NewNetworkCollector(enabled bool) *NetworkCollector
NewNetworkCollector creates a new network collector
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)