diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-08-17 22:12:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-08-17 22:12:23 -0300 |
commit | eced6f81184a67fc47ecb78e802d82a7234ae23d (patch) | |
tree | c0803bdbfe00c423e6cbf40f091a16a3134f4820 /railties | |
parent | 6e6ebeb03cf0ff58c9ef778bfbdd9b0b9891b17b (diff) | |
parent | 91d199259bc7a85763d487a1d0fbf8cd50fe29a0 (diff) | |
download | rails-eced6f81184a67fc47ecb78e802d82a7234ae23d.tar.gz rails-eced6f81184a67fc47ecb78e802d82a7234ae23d.tar.bz2 rails-eced6f81184a67fc47ecb78e802d82a7234ae23d.zip |
Merge pull request #16294 from bf4/code_tools
Update, unify, encapsulate, and fix various code tools in Rails
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/rubyprof_ext.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/railties/lib/rails/rubyprof_ext.rb b/railties/lib/rails/rubyprof_ext.rb deleted file mode 100644 index 017eba3a76..0000000000 --- a/railties/lib/rails/rubyprof_ext.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'prof' - -module Prof #:nodoc: - # Adapted from Shugo Maeda's unprof.rb - def self.print_profile(results, io = $stderr) - total = results.detect { |i| - i.method_class.nil? && i.method_id == :"#toplevel" - }.total_time - total = 0.001 if total < 0.001 - - io.puts " %% cumulative self self total" - io.puts " time seconds seconds calls ms/call ms/call name" - - sum = 0.0 - results.each do |r| - sum += r.self_time - - name = if r.method_class.nil? - r.method_id.to_s - elsif r.method_class.is_a?(Class) - "#{r.method_class}##{r.method_id}" - else - "#{r.method_class}.#{r.method_id}" - end - io.printf "%6.2f %8.3f %8.3f %8d %8.2f %8.2f %s\n", - r.self_time / total * 100, - sum, - r.self_time, - r.count, - r.self_time * 1000 / r.count, - r.total_time * 1000 / r.count, - name - end - end -end |