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

Method Push

pkg/event/queue.go:109–126  ·  view source on GitHub ↗

Push pushes a new event to the channel. Prior to sending the event to the channel, all registered listeners are invoked. The event is sent to the channel if one of the listeners agrees so and no errors are thrown. If the event depends on the state of subsequent events, then we store it in the backlo

(e *Event)

Source from the content-addressed store, hash-verified

107// enriched with callstack parameter and forwarded to the
108// event queue.
109func (q *Queue) Push(e *Event) error {
110 if q.stackEnrichment {
111 // store pending event for callstack enrichment
112 if e.Type.CanEnrichStack() {
113 q.decorator.Push(e)
114 return nil
115 }
116 // decorate events with callstack return addresses
117 if e.IsStackWalk() {
118 e = q.decorator.Pop(e)
119 }
120 }
121 // drop stack walk events
122 if e.IsStackWalk() {
123 return nil
124 }
125 return q.push(e)
126}
127
128func (q *Queue) push(e *Event) error {
129 var enqueue bool

Callers 2

TestQueuePushFunction · 0.95
ProcessEventMethod · 0.45

Calls 4

pushMethod · 0.95
CanEnrichStackMethod · 0.80
IsStackWalkMethod · 0.80
PopMethod · 0.45

Tested by 1

TestQueuePushFunction · 0.76