From 189b5c3c390314da742d7d22cc32c5cc51833130 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 23 Oct 2017 14:58:13 +0300 Subject: 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 --- lib/gitlab/performance_bar/peek_query_tracker.rb | 4 ++-- 1 file 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 -- cgit v1.2.1