Remove Sherlock usage from the performance bar

Sherlock::Query generates a backtrace on every call to "new", which is
very slow. Formatter queries are also not displayed properly due to the
lack of "white-space: pre" in the CSS. We took a look at fixing this,
but the produced output is not really better than just displaying
queries on one line.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/39351
This commit is contained in:
Yorick Peterse 2017-10-23 14:58:13 +03:00
parent bd39b441a1
commit 189b5c3c39
No known key found for this signature in database
GPG Key ID: EDD30D2BEB691AC9
1 changed files with 2 additions and 2 deletions

View File

@ -36,8 +36,8 @@ module Gitlab
end
def track_query(raw_query, bindings, start, finish)
query = Gitlab::Sherlock::Query.new(raw_query, start, finish)
query_info = { duration: query.duration.round(3), sql: query.formatted_query }
duration = finish - start
query_info = { duration: duration.round(3), sql: raw_query }
PEEK_DB_CLIENT.query_details << query_info
end