Module: Trailblazer::Developer::Trace::Debugger::Normalizer::Default

Defined in:
lib/trailblazer/developer/trace/debugger/normalizer.rb

Overview

Default steps for the Debugger::Node options pipeline, following the step-interface.

Class Method Summary collapse

Class Method Details

.compile_id(ctx, task_map_for_activity:, task:) ⇒ Object



26
27
28
# File 'lib/trailblazer/developer/trace/debugger/normalizer.rb', line 26

def self.compile_id(ctx, task_map_for_activity:, task:, **)
  ctx[:compile_id] = task_map_for_activity.fetch(task)[:id]
end

.compile_path(ctx, parent_map:, captured_node:) ⇒ Object



30
31
32
# File 'lib/trailblazer/developer/trace/debugger/normalizer.rb', line 30

def self.compile_path(ctx, parent_map:, captured_node:, **)
  ctx[:compile_path] = Trace::Tree::ParentMap.path_for(parent_map, captured_node)
end

.data(ctx, data: {}) ⇒ Object



48
49
50
# File 'lib/trailblazer/developer/trace/debugger/normalizer.rb', line 48

def self.data(ctx, data: {}, **)
  ctx[:data] = data
end

.label(ctx, label: nil, runtime_id:) ⇒ Object



44
45
46
# File 'lib/trailblazer/developer/trace/debugger/normalizer.rb', line 44

def self.label(ctx, label: nil, runtime_id:, **)
  ctx[:label] = label || runtime_id
end

.runtime_id(ctx, compile_id:) ⇒ Object



34
35
36
# File 'lib/trailblazer/developer/trace/debugger/normalizer.rb', line 34

def self.runtime_id(ctx, compile_id:, **)
  ctx[:runtime_id] = compile_id
end

.runtime_path(ctx, runtime_id:, compile_path:) ⇒ Object



38
39
40
41
42
# File 'lib/trailblazer/developer/trace/debugger/normalizer.rb', line 38

def self.runtime_path(ctx, runtime_id:, compile_path:, **)
  return ctx[:runtime_path] = compile_path if compile_path.empty? # FIXME: this currently only applies to root.

  ctx[:runtime_path] = compile_path[0..-2] + [runtime_id]
end