summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-10-23 14:58:13 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2017-10-23 14:59:07 +0300
commit189b5c3c390314da742d7d22cc32c5cc51833130 (patch)
treee8c68f9b8b22332c037e5e38eb2c98419f8e6b25
parentbd39b441a1525b5cbc9b69170b3d0748c51dd851 (diff)
downloadgitlab-ce-performance-bar-sql.tar.gz
Remove Sherlock usage from the performance barperformance-bar-sql
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
-rw-r--r--lib/gitlab/performance_bar/peek_query_tracker.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/performance_bar/peek_query_tracker.rb b/lib/gitlab/performance_bar/peek_query_tracker.rb
index 67fee8c227d..69e117f1da9 100644
--- a/lib/gitlab/performance_bar/peek_query_tracker.rb
+++ b/lib/gitlab/performance_bar/peek_query_tracker.rb
@@ -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