process

package
v6.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(ruleId, datasourceId int64, vector common.AnomalyPoint) string

func TagHash

func TagHash(vector common.AnomalyPoint) string

Types

type AlertCurEventMap

type AlertCurEventMap struct {
	sync.RWMutex
	Data map[string]*models.AlertCurEvent
}

func NewAlertCurEventMap

func NewAlertCurEventMap(data map[string]*models.AlertCurEvent) *AlertCurEventMap

func (*AlertCurEventMap) Delete

func (a *AlertCurEventMap) Delete(key string)

func (*AlertCurEventMap) Get

func (*AlertCurEventMap) GetAll

func (a *AlertCurEventMap) GetAll() map[string]*models.AlertCurEvent

func (*AlertCurEventMap) Keys

func (a *AlertCurEventMap) Keys() []string

func (*AlertCurEventMap) Set

func (a *AlertCurEventMap) Set(key string, value *models.AlertCurEvent)

func (*AlertCurEventMap) SetAll

func (a *AlertCurEventMap) SetAll(data map[string]*models.AlertCurEvent)

func (*AlertCurEventMap) UpdateLastEvalTime

func (a *AlertCurEventMap) UpdateLastEvalTime(key string, lastEvalTime int64)

type EventMuteHookFunc

type EventMuteHookFunc func(event *models.AlertCurEvent) bool

type ExternalProcessorsType

type ExternalProcessorsType struct {
	ExternalLock sync.RWMutex
	Processors   map[string]*Processor
}
var ExternalProcessors ExternalProcessorsType

func NewExternalProcessors

func NewExternalProcessors() *ExternalProcessorsType

func (*ExternalProcessorsType) GetExternalAlertRule

func (e *ExternalProcessorsType) GetExternalAlertRule(datasourceId, id int64) (*Processor, bool)

type HandleEventFunc

type HandleEventFunc func(event *models.AlertCurEvent)

type Processor

type Processor struct {
	TargetCache    *memsto.TargetCacheType
	BusiGroupCache *memsto.BusiGroupCacheType

	Stats *astats.Stats

	HandleFireEventHook    HandleEventFunc
	HandleRecoverEventHook HandleEventFunc
	EventMuteHook          EventMuteHookFunc
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(rule *models.AlertRule, datasourceId int64, atertRuleCache *memsto.AlertRuleCacheType, targetCache *memsto.TargetCacheType,
	busiGroupCache *memsto.BusiGroupCacheType, alertMuteCache *memsto.AlertMuteCacheType, datasourceCache *memsto.DatasourceCacheType, ctx *ctx.Context,
	stats *astats.Stats) *Processor

func (*Processor) BuildEvent

func (p *Processor) BuildEvent(anomalyPoint common.AnomalyPoint, from string, now int64) *models.AlertCurEvent

func (*Processor) DatasourceId

func (p *Processor) DatasourceId() int64

func (*Processor) Handle

func (p *Processor) Handle(anomalyPoints []common.AnomalyPoint, from string, inhibit bool)

func (*Processor) HandleRecover

func (p *Processor) HandleRecover(alertingKeys map[string]struct{}, now int64)

func (*Processor) Hash

func (p *Processor) Hash() string

func (*Processor) Key

func (p *Processor) Key() string

func (*Processor) RecoverAlertCurEventFromDb

func (p *Processor) RecoverAlertCurEventFromDb()

func (*Processor) RecoverSingle

func (p *Processor) RecoverSingle(hash string, now int64, value *string)

Jump to

Keyboard shortcuts

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