Commit 3a0bcca8 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents ac045a79 9a9aa223
......@@ -10,6 +10,18 @@ elsif Gitlab::Database.postgresql?
require 'peek-pg'
PEEK_DB_CLIENT = ::PG::Connection
PEEK_DB_VIEW = Peek::Views::PG
# Remove once we have https://github.com/peek/peek-pg/pull/10
module ::Peek::PGInstrumented
def exec_params(*args)
start = Time.now
super(*args)
ensure
duration = (Time.now - start)
PEEK_DB_CLIENT.query_time.update { |value| value + duration }
PEEK_DB_CLIENT.query_count.update { |value| value + 1 }
end
end
else
raise "Unsupported database adapter for peek!"
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment