Sha256: cd99e3b84f8561a1b0675e716d268050e8ee0db080b18e0150ca9358cd1d8148
Contents?: true
Size: 951 Bytes
Versions: 17
Compression:
Stored size: 951 Bytes
Contents
class RSolr::Connection alias_method :execute_without_profiling, :execute def execute_with_profiling(client, request_context) return execute_without_profiling(client, request_context) unless SqlPatches.should_measure? start = Time.now result = execute_without_profiling(client, request_context) elapsed_time = SqlPatches.elapsed_time(start) data = "#{request_context[:method].upcase} #{request_context[:uri]}" if request_context[:method] == :post and request_context[:data] if request_context[:headers].include?("Content-Type") and request_context[:headers]["Content-Type"] == "text/xml" # it's xml, unescaping isn't needed data << "\n#{request_context[:data]}" else data << "\n#{Rack::Utils.unescape(request_context[:data])}" end end ::Rack::MiniProfiler.record_sql(data, elapsed_time) result end alias_method :execute, :execute_with_profiling end
Version data entries
17 entries across 17 versions & 2 rubygems