MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / NewEngine

Function NewEngine

pkg/rules/engine.go:132–146  ·  view source on GitHub ↗

NewEngine builds a fresh rules engine instance.

(psnap ps.Snapshotter, config *config.Config)

Source from the content-addressed store, hash-verified

130
131// NewEngine builds a fresh rules engine instance.
132func NewEngine(psnap ps.Snapshotter, config *config.Config) *Engine {
133 e := &Engine{
134 filters: newFilterset(),
135 matches: make([]*ruleMatch, 0),
136 sequences: make([]*sequenceState, 0),
137 psnap: psnap,
138 config: config,
139 scavenger: time.NewTicker(sequenceGcInterval),
140 compiler: newCompiler(psnap, config),
141 }
142
143 go e.gcSequences()
144
145 return e
146}
147
148func (e *Engine) gcSequences() {
149 for {

Callers 9

NewAppFunction · 0.92
fireRulesFunction · 0.85
TestRunSequenceRuleFunction · 0.85
TestAlertActionFunction · 0.85
TestKillActionFunction · 0.85
BenchmarkRunRulesFunction · 0.85

Calls 3

gcSequencesMethod · 0.95
newFiltersetFunction · 0.85
newCompilerFunction · 0.85

Tested by 8

fireRulesFunction · 0.68
TestRunSequenceRuleFunction · 0.68
TestAlertActionFunction · 0.68
TestKillActionFunction · 0.68
BenchmarkRunRulesFunction · 0.68