sampler

package
v0.0.0-...-982fff5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: AFL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LocalIp = "local_ip"

Variables

This section is empty.

Functions

This section is empty.

Types

type CpuMemSample

type CpuMemSample struct {
	Config model.CpuMemConfs //对应配置
	// contains filtered or unexported fields
}

func (*CpuMemSample) Execute

func (s *CpuMemSample) Execute(wg *sync.WaitGroup) error

func (*CpuMemSample) GetConfigPtr

func (s *CpuMemSample) GetConfigPtr() interface{}

func (*CpuMemSample) GetMetricName

func (s *CpuMemSample) GetMetricName() string

func (*CpuMemSample) SetName

func (s *CpuMemSample) SetName(str string)

type CpuSample

type CpuSample struct {
	Config model.CpuConfs //对应配置
	// contains filtered or unexported fields
}

func (*CpuSample) Execute

func (s *CpuSample) Execute(wg *sync.WaitGroup) error

func (*CpuSample) GetConfigPtr

func (s *CpuSample) GetConfigPtr() interface{}

func (*CpuSample) GetMetricName

func (s *CpuSample) GetMetricName() string

func (*CpuSample) SetName

func (s *CpuSample) SetName(str string)

type DiskSample

type DiskSample struct {
	Config model.DiskConfs //对应配置
	// contains filtered or unexported fields
}

func (*DiskSample) Execute

func (s *DiskSample) Execute(wg *sync.WaitGroup) error

func (*DiskSample) GetConfigPtr

func (s *DiskSample) GetConfigPtr() interface{}

func (*DiskSample) GetMetricName

func (s *DiskSample) GetMetricName() string

func (*DiskSample) SetName

func (s *DiskSample) SetName(str string)

type MemSample

type MemSample struct {
	Config model.MemConfs //对应配置
	// contains filtered or unexported fields
}

memory_used采样器结构,实现Sampler接口

func (*MemSample) Execute

func (s *MemSample) Execute(wg *sync.WaitGroup) error

采样执行的动作,配置改变时也进行进入判断,

func (*MemSample) GetConfigPtr

func (s *MemSample) GetConfigPtr() interface{}

func (*MemSample) GetMetricName

func (s *MemSample) GetMetricName() string

func (*MemSample) SetName

func (s *MemSample) SetName(str string)

type Sampler

type Sampler interface {
	Execute(wg *sync.WaitGroup) error //执行采样并发送
	GetMetricName() string            //获取该采样器的指标名字
	GetConfigPtr() interface{}        //用于更新配置
}

Sampler 指标(名词)--->采样器(执行者).采样器接口定义

Jump to

Keyboard shortcuts

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