NewStackwalkDecorator creates a new callstack return addresses decorator which receives the event queue for long-standing event flushing.
(q *Queue)
| 70 | // addresses decorator which receives the event queue |
| 71 | // for long-standing event flushing. |
| 72 | func NewStackwalkDecorator(q *Queue) *StackwalkDecorator { |
| 73 | s := &StackwalkDecorator{ |
| 74 | q: q, |
| 75 | buckets: make(map[uint64][]*Event), |
| 76 | procs: make(map[uint32]*Event), |
| 77 | flusher: time.NewTicker(flusherInterval), |
| 78 | quit: make(chan struct{}, 1), |
| 79 | } |
| 80 | |
| 81 | go s.doFlush() |
| 82 | |
| 83 | return s |
| 84 | } |
| 85 | |
| 86 | // Push pushes a new event to the queue. |
| 87 | func (s *StackwalkDecorator) Push(e *Event) { |