Flowdock
method

render_with_benchmark

Importance_0
v2.1.0 - Show latest stable - 0 notes - Class: ActionController::Benchmarking
render_with_benchmark(options = nil, extra_options = {}, &block) protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_controller/benchmarking.rb, line 44
      def render_with_benchmark(options = nil, extra_options = {}, &block)
        unless logger
          render_without_benchmark(options, extra_options, &block)
        else
          db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected?

          render_output = nil
          @rendering_runtime = Benchmark::realtime{ render_output = render_without_benchmark(options, extra_options, &block) }

          if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected?
            @db_rt_before_render = db_runtime
            @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime
            @rendering_runtime -= @db_rt_after_render
          end

          render_output
        end
      end
Register or log in to add new notes.