collector

package
v0.0.0-...-9021772 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Stages []*Stage `json:"stages"`
	// contains filtered or unexported fields
}

Collector 数据采集器,用于采集 Job 的输出

func NewCollector

func NewCollector(collectors *Collectors, jobID string) *Collector

NewCollector 创建一个新的数据采集器

func (*Collector) AllStages

func (col *Collector) AllStages() []*Stage

func (*Collector) Build

func (col *Collector) Build() []byte

Build 转换为文本输出

func (*Collector) Finish

func (col *Collector) Finish()

func (*Collector) HasError

func (col *Collector) HasError() bool

HasError return whether there is an error message

func (*Collector) Index

func (col *Collector) Index() int

func (*Collector) Stage

func (col *Collector) Stage(name string) *Stage

Stage 创建一个 Stage

type Collectors

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

Collectors 用于存储当前活跃的所有collector

func NewCollectors

func NewCollectors() *Collectors

func (*Collectors) Add

func (cols *Collectors) Add(col *Collector)

func (*Collectors) Get

func (cols *Collectors) Get(id string) *Collector

func (*Collectors) Names

func (cols *Collectors) Names() []string

func (*Collectors) Remove

func (cols *Collectors) Remove(name string)

type ConsoleMessage

type ConsoleMessage struct {
	Stage        *Stage
	StageMessage StageMessage
}

type Progress

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

func NewProgress

func NewProgress(max int) *Progress

func (*Progress) Add

func (p *Progress) Add(count int)

func (*Progress) Max

func (p *Progress) Max() int

func (*Progress) Percentage

func (p *Progress) Percentage() float32

func (*Progress) SetTotal

func (p *Progress) SetTotal(total int)

func (*Progress) Total

func (p *Progress) Total() int

type ServiceProvider

type ServiceProvider struct{}

func (ServiceProvider) Boot

func (s ServiceProvider) Boot(app *glacier.Glacier)

func (ServiceProvider) Register

func (s ServiceProvider) Register(app *container.Container)

type Stage

type Stage struct {
	Name       string         `json:"name"`
	Messages   []StageMessage `json:"messages"`
	Percentage float32        `json:"percentage"`
	Max        int            `json:"max"`
	Total      int            `json:"total"`
	// contains filtered or unexported fields
}

Stage 采集阶段

func (*Stage) Error

func (s *Stage) Error(message string)

Error 错误输出

func (*Stage) Errorf

func (s *Stage) Errorf(format string, a ...interface{}) error

func (*Stage) Finish

func (s *Stage) Finish()

func (*Stage) GetProgress

func (s *Stage) GetProgress() *Progress

func (*Stage) Info

func (s *Stage) Info(message string)

Info 标准输出

func (*Stage) Infof

func (s *Stage) Infof(format string, a ...interface{}) string

func (*Stage) Progress

func (s *Stage) Progress(max int) *Progress

type StageMessage

type StageMessage struct {
	Index     int       `json:"index"`
	Timestamp time.Time `json:"timestamp"`
	Level     string    `json:"level"`
	Message   string    `json:"message"`
}

Jump to

Keyboard shortcuts

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