class RubyProf::FlameGraphJsonPrinter::FlameDataWalker

Attributes

height[R]
output[R]

Public Class Methods

new(output, threads, options={}) click to toggle source
Calls superclass method RubyProf::Walker::new
# File lib/ruby-prof/printers/flame_graph_json_printer.rb, line 46
def initialize(output, threads, options={})
  super(threads, options)
  @output = output

  @printer = FlameDataJsonPrinter.new(@output, {
    depth: 1,
    anchored: false
  })

  @height = 0
  @depth = 0
end

Public Instance Methods

enter_frame(type, obj, name, called, self_value, total_value) click to toggle source
# File lib/ruby-prof/printers/flame_graph_json_printer.rb, line 59
def enter_frame(type, obj, name, called, self_value, total_value)
  @depth += 1
  @height = @depth if @height < @depth
  @printer.enter(name, called, self_value, total_value)
end
leave_frame(type, obj) click to toggle source
# File lib/ruby-prof/printers/flame_graph_json_printer.rb, line 65
def leave_frame(type, obj)
  @printer.leave
  @depth -= 1
end