Sha256: 8239cb883cfc1d699e8b49b89035d04df7fc0a211cf08f5c180d8fb1d58eab5d

Contents?: true

Size: 862 Bytes

Versions: 24

Compression:

Stored size: 862 Bytes

Contents

module ThinkingSphinx
  module ActionController
    extend ActiveSupport::Concern

    protected

    attr_internal :query_runtime

    def cleanup_view_runtime
      log_subscriber = ThinkingSphinx::ActiveRecord::LogSubscriber
      query_runtime_pre_render = log_subscriber.reset_runtime
      runtime = super
      query_runtime_post_render = log_subscriber.reset_runtime
      self.query_runtime = query_runtime_pre_render + query_runtime_post_render
      runtime - query_runtime_post_render
    end

    def append_info_to_payload(payload)
      super
      payload[:query_runtime] = query_runtime
    end

    module ClassMethods
      def log_process_action(payload)
        messages, query_runtime = super, payload[:query_runtime]
        messages << ("Sphinx: %.1fms" % query_runtime.to_f) if query_runtime
        messages
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
friendlyfashion-thinking-sphinx-2.0.14.4 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.14.3 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.1.0 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.14.2 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.14.1 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.14 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.13.3 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.13.2 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.13.1 lib/thinking_sphinx/action_controller.rb
friendlyfashion-thinking-sphinx-2.0.13 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.13 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.12 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.11 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.10 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.9 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.8 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.7 lib/thinking_sphinx/action_controller.rb
thinking-sphinx-2.0.5 lib/thinking_sphinx/action_controller.rb
sayso-thinking-sphinx-2.0.3.002 lib/thinking_sphinx/action_controller.rb
sayso-thinking-sphinx-2.0.3.001 lib/thinking_sphinx/action_controller.rb