diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/peek | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/peek')
-rw-r--r-- | lib/peek/views/active_record.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/peek/views/active_record.rb b/lib/peek/views/active_record.rb index 8e1200338c2..a3fe206c86f 100644 --- a/lib/peek/views/active_record.rb +++ b/lib/peek/views/active_record.rb @@ -66,7 +66,8 @@ module Peek backtrace: Gitlab::BacktraceCleaner.clean_backtrace(caller), cached: data[:cached] ? 'Cached' : '', transaction: data[:connection].transaction_open? ? 'In a transaction' : '', - db_role: db_role(data) + db_role: db_role(data), + db_config_name: "Config name: #{::Gitlab::Database.db_config_name(data[:connection])}" } end @@ -76,7 +77,15 @@ module Peek role = ::Gitlab::Database::LoadBalancing.db_role_for_connection(data[:connection]) || ::Gitlab::Database::LoadBalancing::ROLE_UNKNOWN - role.to_s.capitalize + "Role: #{role.to_s.capitalize}" + end + + def format_call_details(call) + if ENV['GITLAB_MULTIPLE_DATABASE_METRICS'] + super + else + super.except(:db_config_name) + end end end end |