Commit 1c7c5e7885d77f6a10063fef716a79ef6782aed2

Authored by Marius Hanne
1 parent 3ca92ab6ba
Exists in profile

profile node

Showing 1 changed file with 10 additions and 1 deletions Side-by-side Diff

bin/bitcoin_blockchain
... ... @@ -130,5 +130,14 @@
130 130 options[:connect] = options[:connect] == "" ? [] : options[:connect].split(',').map{|h| h.split(':')}
131 131  
132 132 node = Bitcoin::Network::Node.new(options)
133   -node.run
  133 +
  134 +require 'ruby-prof'
  135 +res = RubyProf.profile do
  136 + node.run
  137 +end
  138 +
  139 +printer = RubyProf::GraphHtmlPrinter.new(res)
  140 +File.open("profile.html", "w") do |f|
  141 + printer.print(f, :min_percent=>1)
  142 +end