Skip to content

Commit

Permalink
Merge [8355] from trunk: fix strange NoMemoryError on amd64. References
Browse files Browse the repository at this point in the history
rails#10442 [wrb]

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@8356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Dec 10, 2007
1 parent 1878f6c commit e85fcc0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions actionpack/lib/action_controller/benchmarking.rb
Expand Up @@ -75,15 +75,16 @@ def perform_action_with_benchmark

private
def rendering_runtime(runtime)
" | Rendering: #{sprintf("%.5f", @rendering_runtime)} (#{sprintf("%d", (@rendering_runtime * 100) / runtime)}%)"
percentage = @rendering_runtime * 100 / runtime
" | Rendering: %.5f (%d%%)" % [@rendering_runtime, percentage.to_i]
end

def active_record_runtime(runtime)
db_runtime = ActiveRecord::Base.connection.reset_runtime
db_runtime += @db_rt_before_render if @db_rt_before_render
db_runtime += @db_rt_after_render if @db_rt_after_render
db_percentage = (db_runtime * 100) / runtime
" | DB: #{sprintf("%.5f", db_runtime)} (#{sprintf("%d", db_percentage)}%)"
db_percentage = db_runtime * 100 / runtime
" | DB: %.5f (%d%%)" % [db_runtime, db_percentage.to_i]
end
end
end

0 comments on commit e85fcc0

Please sign in to comment.