processor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BooleanType vType = "boolean"
	StringType  vType = "string"
	IntType     vType = "int"
)
View Source
const (
	ProcessorDefaultType string = "processor_default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedConfig

type AggregatedConfig struct {
	KindMap map[string][]KindConfig
}

type AggregatedKindConfig

type AggregatedKindConfig struct {
	OutputName         string  `mapstructure:"output_name"`
	Kind               string  `mapstructure:"kind"`
	ExplicitBoundaries []int64 `mapstructure:"explicit_boundaries"`
}

type Aggregator

type Aggregator interface {
	Aggregate(data *model.DataBlock, selectors *LabelSelectors)
	Dump() []*model.DataBlock
}

type AggregatorKind

type AggregatorKind int
const (
	SumKind AggregatorKind = iota
	MaxKind
	AvgKind
	LastKind
	CountKind
	HistogramKind
)

func GetAggregatorKind

func GetAggregatorKind(kind string) AggregatorKind

type Config

type Config struct {
	TickerInterval   int                               `mapstructure:"ticker_interval"`
	SessionInfos     []Session                         `mapstructure:"sessioninfo"`
	AggregateKindMap map[string][]AggregatedKindConfig `mapstructure:"aggregate_kind_map"`
}

func NewConfig

func NewConfig() *Config

type DefaultAggregator

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

func NewDefaultAggregator

func NewDefaultAggregator(config *AggregatedConfig) *DefaultAggregator

func (*DefaultAggregator) Aggregate

func (d *DefaultAggregator) Aggregate(data *model.DataBlock, selectors *LabelSelectors)

Aggregate 往aggregatorMap中写聚合数据, 在Consume接口中调用Aggregate聚合

func (*DefaultAggregator) Dump

func (d *DefaultAggregator) Dump() []*model.DataBlock

type DefaultProcessor

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

func (*DefaultProcessor) Consume

func (d *DefaultProcessor) Consume(data *model.DataBlock) error

receive data by Consume from upstream and send data by runTicker with d.consumer.Consume(agg)

type KindConfig

type KindConfig struct {
	OutputName string
	Kind       AggregatorKind
	// Only HistogramKind has this value
	ExplicitBoundaries []int64
}

type LabelKey

type LabelKey struct {
	Name  string
	Value string
	VType vType
	sort.Interface
}

type LabelKeys

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

func GetLabelsKeys

func GetLabelsKeys(attributeMap *model.AttributeMap) *LabelKeys

func NewLabelKeys

func NewLabelKeys(keys ...LabelKey) *LabelKeys

func (*LabelKeys) GetLabels

func (k *LabelKeys) GetLabels() *model.AttributeMap

func (*LabelKeys) Len

func (k *LabelKeys) Len() int

func (*LabelKeys) Less

func (k *LabelKeys) Less(i, j int) bool

func (*LabelKeys) Swap

func (k *LabelKeys) Swap(i, j int)

type LabelSelector

type LabelSelector struct {
	Name  string
	VType vType
}

type LabelSelectors

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

func NewLabelSelectors

func NewLabelSelectors(selectors ...LabelSelector) *LabelSelectors

func (*LabelSelectors) AppendSelectors

func (s *LabelSelectors) AppendSelectors(selectors ...LabelSelector)

func (*LabelSelectors) GetLabelKeys

func (s *LabelSelectors) GetLabelKeys(labels *model.AttributeMap) *LabelKeys

type Processor

type Processor interface {
	consumer.Consumer
}

func NewDefaultProcessor

func NewDefaultProcessor(cfg any, con consumer.Consumer) Processor

type Session

type Session struct {
	Class  string            `mapstructure:"class"`
	Name   string            `mapstructure:"name"`
	Params map[string]string `mapstructure:"params"`
}

Jump to

Keyboard shortcuts

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