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