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

Method RunSequence

pkg/filter/filter.go:383–411  ·  view source on GitHub ↗
(e *event.Event, seqID int, partials map[int][]*event.Event, rawMatch bool)

Source from the content-addressed store, hash-verified

381}
382
383func (f *filter) RunSequence(e *event.Event, seqID int, partials map[int][]*event.Event, rawMatch bool) bool {
384 if f.seq == nil {
385 return false
386 }
387 nseqs := len(f.seq.Expressions)
388 if seqID > nseqs-1 {
389 return false
390 }
391 valuer := f.mapValuer(e)
392 defer valuerPool.Put(valuer)
393 expr := f.seq.Expressions[seqID]
394
395 if rawMatch {
396 // only check if the condition matches
397 // without evaluating joins/bound fields
398 return ql.Eval(expr.Expr, valuer, f.hasFunctions)
399 }
400
401 var match bool
402 if seqID >= 1 && expr.HasBoundFields() {
403 // evaluate bound field driven sequences
404 match = f.evalBoundSequence(e, seqID, &expr, partials, valuer)
405 } else {
406 // evaluate constrained/unconstrained sequences
407 match = f.evalSequence(e, seqID, &expr, partials, valuer)
408 }
409
410 return match
411}
412
413func (f *filter) GetStringFields() map[fields.Field][]string { return f.stringFields }
414func (f *filter) GetFields() []Field { return f.fields }

Callers

nothing calls this directly

Calls 6

mapValuerMethod · 0.95
evalBoundSequenceMethod · 0.95
evalSequenceMethod · 0.95
EvalFunction · 0.92
HasBoundFieldsMethod · 0.80
PutMethod · 0.65

Tested by

no test coverage detected