diff options
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 |