class PG::Connection
Public Instance Methods
Source
# File lib/patches/db/pg/alias_method.rb, line 108 def async_exec(*args, &blk) return async_exec_without_profiling(*args, &blk) unless SqlPatches.should_measure? start = Process.clock_gettime(Process::CLOCK_MONOTONIC) result = exec_without_profiling(*args, &blk) elapsed_time = SqlPatches.elapsed_time(start) record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time) result.instance_variable_set("@miniprofiler_sql_id", record) if result result end
Also aliased as: async_exec_without_profiling
Source
# File lib/patches/db/pg/alias_method.rb, line 54 def exec(*args, &blk) return exec_without_profiling(*args, &blk) unless SqlPatches.should_measure? start = Process.clock_gettime(Process::CLOCK_MONOTONIC) result = exec_without_profiling(*args, &blk) elapsed_time = SqlPatches.elapsed_time(start) record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time) result.instance_variable_set("@miniprofiler_sql_id", record) if result result end
Also aliased as: exec_without_profiling, query, query
Source
# File lib/patches/db/pg/alias_method.rb, line 67 def exec_params(*args, &blk) return exec_params_without_profiling(*args, &blk) unless SqlPatches.should_measure? start = Process.clock_gettime(Process::CLOCK_MONOTONIC) result = exec_params_without_profiling(*args, &blk) elapsed_time = SqlPatches.elapsed_time(start) record = ::Rack::MiniProfiler.record_sql(args[0], elapsed_time) result.instance_variable_set("@miniprofiler_sql_id", record) if result result end
Source
# File lib/patches/db/pg/alias_method.rb, line 80 def exec_prepared(*args, &blk) return exec_prepared_without_profiling(*args, &blk) unless SqlPatches.should_measure? start = Process.clock_gettime(Process::CLOCK_MONOTONIC) result = exec_prepared_without_profiling(*args, &blk) elapsed_time = SqlPatches.elapsed_time(start) mapped = args[0] mapped = @prepare_map[mapped] || args[0] if @prepare_map record = ::Rack::MiniProfiler.record_sql(mapped, elapsed_time) result.instance_variable_set("@miniprofiler_sql_id", record) if result result end
Also aliased as: exec_prepared_without_profiling
Source
# File lib/patches/db/pg/alias_method.rb, line 41 def prepare(*args, &blk) # we have no choice but to do this here, # if we do the check for profiling first, our cache may miss critical stuff @prepare_map ||= {} @prepare_map[args[0]] = args[1] # dont leak more than 10k ever @prepare_map = {} if @prepare_map.length > 1000 return prepare_without_profiling(*args, &blk) unless SqlPatches.should_measure? prepare_without_profiling(*args, &blk) end
Also aliased as: prepare_without_profiling
Source
# File lib/patches/db/pg/alias_method.rb, line 94 def send_query_prepared(*args, &blk) return send_query_prepared_without_profiling(*args, &blk) unless SqlPatches.should_measure? start = Process.clock_gettime(Process::CLOCK_MONOTONIC) result = send_query_prepared_without_profiling(*args, &blk) elapsed_time = SqlPatches.elapsed_time(start) mapped = args[0] mapped = @prepare_map[mapped] || args[0] if @prepare_map record = ::Rack::MiniProfiler.record_sql(mapped, elapsed_time) result.instance_variable_set("@miniprofiler_sql_id", record) if result result end
Also aliased as: send_query_prepared_without_profiling