lib/tracebin/patches/postgres.rb in tracebin-0.0.10 vs lib/tracebin/patches/postgres.rb in tracebin-0.0.11
- old
+ new
@@ -1,13 +1,13 @@
::PG::Connection.class_eval do
alias_method :exec_without_tracebin, :exec
alias_method :exec_params_without_tracebin, :exec_params
def exec_params(*args, &block)
- start_time = Time.now
+ start_time = ::Tracebin::PatchHelper.timestamp_string
result = exec_params_without_tracebin(*args, &block)
- end_time = Time.now
+ end_time = ::Tracebin::PatchHelper.timestamp_string
event_data = [
'sql.postgres_exec',
start_time,
end_time,
@@ -20,12 +20,12 @@
result
end
def exec(*args, &block)
- start_time = Time.now
+ start_time = ::Tracebin::PatchHelper.timestamp_string
result = exec_without_tracebin(*args, &block)
- end_time = Time.now
+ end_time = ::Tracebin::PatchHelper.timestamp_string
event_data = [
'sql.postgres_exec',
start_time,
end_time,