Method: OneApm::TransactionSample::Segment#to_debug_str

Defined in:
lib/one_apm/transaction/segment.rb

#to_debug_str(depth) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/one_apm/transaction/segment.rb', line 66

def to_debug_str(depth)
  tab = "  " * depth
  s = tab.clone
  s << ">> #{'%3i ms' % (@entry_timestamp*1000)} [#{self.class.name.split("::").last}] #{metric_name} \n"
  unless params.empty?
    params.each do |k,v|
      s << "#{tab}    -#{'%-16s' % k}: #{v.to_s[0..80]}\n"
    end
  end
  called_segments.each do |cs|
    s << cs.to_debug_str(depth + 1)
  end
  s << tab + "<< "
  s << case @exit_timestamp
       when nil then ' n/a'
       when Numeric then '%3i ms' % (@exit_timestamp*1000)
       else @exit_timestamp.to_s
       end
  s << " #{metric_name}\n"
end