Class: TraceViz::Collectors::TracePipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/trace_viz/collectors/trace_pipeline.rb

Instance Method Summary collapse

Constructor Details

#initializeTracePipeline

Returns a new instance of TracePipeline.



6
7
8
# File 'lib/trace_viz/collectors/trace_pipeline.rb', line 6

def initialize
  @steps = []
end

Instance Method Details

#add_step(step) ⇒ Object



10
11
12
# File 'lib/trace_viz/collectors/trace_pipeline.rb', line 10

def add_step(step)
  @steps << step
end

#process(trace_data) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/trace_viz/collectors/trace_pipeline.rb', line 14

def process(trace_data)
  @steps.each do |step|
    trace_data = step.call(trace_data)
    return nil unless trace_data
  end
  trace_data
rescue StandardError => e
  TraceViz.logger.error("Pipeline processing failed for trace_data ID: #{trace_data.id} - #{e.message}")
  nil
end