Skip to content

Instantly share code, notes, and snippets.

@denisovlev
Last active February 16, 2017 14:24
Show Gist options
  • Save denisovlev/c617deea1c34e5a89150 to your computer and use it in GitHub Desktop.
Save denisovlev/c617deea1c34e5a89150 to your computer and use it in GitHub Desktop.
result = RubyProf.profile {
enqueue_stats(cur_line_time, stat_time_block)
}
open('output2.html', 'w') do |f|
RubyProf::GraphHtmlPrinter.new(result).print(f, :min_percent => 5)
end
# https://github.com/ruby-prof/ruby-prof/blob/master/examples/graph.txt
# merge fibers
prof = RubyProf::Profile.new(merge_fibers: true)
prof.start
Acquisition::CreateWorkloadService.new(log).create_clustered_workload(User.with_role(:admin).first, opts)
result = prof.stop
result.eliminate_methods!([/Hash#each/, /Array#map/, /Array#each/, /Class#new/, /Set#each/, /Enumerator#next/, /Kernel#loop/, /Enumerator#each/, /Enumerable#map/])
open('output2.html', 'w') do |f|
RubyProf::GraphHtmlPrinter.new(result).print(f, :min_percent => 5)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment