Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-11-03 22:02:52 +0300
committerMike Greiling <mike@pixelcog.com>2017-11-03 22:02:52 +0300
commit72157766a2c5b65bece2077c8b3eddcb8af5b374 (patch)
tree5b9c3d0d9d1392d4859c22b2584a03332b3b48c3 /lib
parent817c7fb1b0cbd0d008706e060c4cecd0401b5f0c (diff)
parent4841c3cb4565996b1a54ef045f9f84548dcc5d6a (diff)
Merge branch 'master' into sh-headless-chrome-support
* master: (33 commits) Ignore SQL CACHE hits in Sherlock Fix SQL timings for the performance bar Find the LFS-objects for a fork within a the fork network Remove bottom-border from last responsive table row Add system hooks user_rename and group_rename Unlink a project from a fork network when it's source was deleted. Make sure the settings page renders when root of a fork is deleted Remove Peek's original keyboard shortcut (numpad 0, keycode 96) Add application setting to Auto DevOps docs Enable MergeableSelector in scss-lint (for !14567) Enable MergeableSelector in scss-lint (for !14055) Enable MergeableSelector in scss-lint (for !14062) Enable MergeableSelector in scss-lint (for !14398) Enable MergeableSelector in scss-lint (for !13480) Enable MergeableSelector in scss-lint (for !13473) Enable MergeableSelector in scss-lint (for !13600) Enable MergeableSelector in scss-lint Resolve ""To do" should be "Todos" on Todos list page" Avoid regenerating the ref path for the environment Remove white space at bottom of issue boards ...
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/performance_bar/peek_query_tracker.rb2
-rw-r--r--lib/gitlab/sherlock/transaction.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/performance_bar/peek_query_tracker.rb b/lib/gitlab/performance_bar/peek_query_tracker.rb
index 69e117f1da9..f2825db59ae 100644
--- a/lib/gitlab/performance_bar/peek_query_tracker.rb
+++ b/lib/gitlab/performance_bar/peek_query_tracker.rb
@@ -36,7 +36,7 @@ module Gitlab
end
def track_query(raw_query, bindings, start, finish)
- duration = finish - start
+ duration = (finish - start) * 1000.0
query_info = { duration: duration.round(3), sql: raw_query }
PEEK_DB_CLIENT.query_details << query_info
diff --git a/lib/gitlab/sherlock/transaction.rb b/lib/gitlab/sherlock/transaction.rb
index 3489fb251b6..400a552bf99 100644
--- a/lib/gitlab/sherlock/transaction.rb
+++ b/lib/gitlab/sherlock/transaction.rb
@@ -89,7 +89,9 @@ module Gitlab
ActiveSupport::Notifications.subscribe('sql.active_record') do |_, start, finish, _, data|
next unless same_thread?
- track_query(data[:sql].strip, data[:binds], start, finish)
+ unless data.fetch(:cached, data[:name] == 'CACHE')
+ track_query(data[:sql].strip, data[:binds], start, finish)
+ end
end
end