Method: StackProf::Report#flamegraph_stacks

Defined in:
lib/stackprof/report.rb

#flamegraph_stacks(raw) ⇒ Object



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/stackprof/report.rb', line 187

def flamegraph_stacks(raw)
  stacks = []
  max_x = 0
  max_y = 0
  idx = 0

  while len = raw[idx]
    idx += 1
    max_y = len if len > max_y
    stack = raw.slice(idx, len+1)
    idx += len+1
    stacks << stack
    max_x += stack.last
  end

  return stacks, max_x, max_y
end