strategies

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registrar = &StrategyRegistrar{
	Strategies: make(map[time.Duration][]Strategy),
}

Functions

This section is empty.

Types

type CpuTimes

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

func (*CpuTimes) Options

func (s *CpuTimes) Options() Options

func (*CpuTimes) Run

func (s *CpuTimes) Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error

type DiskUsage

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

func (*DiskUsage) Options

func (s *DiskUsage) Options() Options

func (*DiskUsage) Run

func (s *DiskUsage) Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error

type LoadAvg

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

func (*LoadAvg) Options

func (s *LoadAvg) Options() Options

func (*LoadAvg) Run

func (s *LoadAvg) Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error

type Memory

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

func (*Memory) Options

func (s *Memory) Options() Options

func (*Memory) Run

func (s *Memory) Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error

type Net added in v1.4.0

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

func (*Net) Options added in v1.4.0

func (s *Net) Options() Options

func (*Net) Run added in v1.4.0

func (s *Net) Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error

type Options

type Options struct {
	Namespace string
	Id        string
	Frequency time.Duration
}

type Strategy

type Strategy interface {
	Options() Options
	Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error
}

Strategy provides a common interface for different monitoring tasks.

type StrategyRegistrar

type StrategyRegistrar struct {
	Strategies map[time.Duration][]Strategy
}

func (*StrategyRegistrar) RegisterStrategy

func (r *StrategyRegistrar) RegisterStrategy(strategy Strategy)

type Uptime

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

func (*Uptime) Options

func (s *Uptime) Options() Options

func (*Uptime) Run

func (s *Uptime) Run(ctx context.Context, dataCh chan<- []*pb.MetricsPayload_Metric) error

Jump to

Keyboard shortcuts

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