Class: RubyProf::FlameGraphJsonPrinter
Defined Under Namespace
Classes: FlameDataJsonPrinter, FlameDataWalker
Instance Method Summary
collapse
#initialize, #method_name, #print, #print_file, #print_footer, #print_header, #print_thread, #setup_options, #sort_method
Instance Method Details
#min_percent ⇒ Object
5
6
7
|
# File 'lib/ruby-prof/printers/flame_graph_json_printer.rb', line 5
def min_percent
@options[:min_percent] || 0.25
end
|
#min_self_time ⇒ Object
9
10
11
|
# File 'lib/ruby-prof/printers/flame_graph_json_printer.rb', line 9
def min_self_time
@options[:min_self_time] || 0.001
end
|
#only_threads ⇒ Object
13
14
15
|
# File 'lib/ruby-prof/printers/flame_graph_json_printer.rb', line 13
def only_threads
@options[:only_threads]
end
|
#print_threads ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/ruby-prof/printers/flame_graph_json_printer.rb', line 17
def print_threads
@threads = @result.threads.dup
@threads.select! { |t| only_thread_ids.include?(t.id) } if only_threads
walker = FlameDataWalker.new(@output, @threads, {
min_percent: min_percent,
min_self_time: min_self_time
})
@output << "{\n"
@output << " \"root\": "
walker.run
@output << ",\n"
@output << " \"depth\": #{walker.height}\n"
@output << "}"
end
|