Commit 01f2186e authored by Stan Hu's avatar Stan Hu

Merge branch 'include-all-postgres-queries-in-performance-bar-summary' into 'master'

Include all queries in the performance bar summary

Closes #61372

See merge request gitlab-org/gitlab-ce!28063
parents 22aa45c8 179676ae
...@@ -10,6 +10,18 @@ elsif Gitlab::Database.postgresql? ...@@ -10,6 +10,18 @@ elsif Gitlab::Database.postgresql?
require 'peek-pg' require 'peek-pg'
PEEK_DB_CLIENT = ::PG::Connection PEEK_DB_CLIENT = ::PG::Connection
PEEK_DB_VIEW = Peek::Views::PG 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 else
raise "Unsupported database adapter for peek!" raise "Unsupported database adapter for peek!"
end 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