Commit 5e489195 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖

Automatic merge of gitlab-org/gitlab-ce master

parents 0b472c2d de61dc4c
Pipeline #51414057 passed with stages
in 73 minutes and 23 seconds
# frozen_string_literal: true
RSpec.configure do |config|
config.before do
if Gitlab::Database.postgresql? && ENV['PG_STAT_WARNING_THRESHOLD']
warning_threshold = ENV['PG_STAT_WARNING_THRESHOLD'].to_i
results = ActiveRecord::Base.connection.execute('SELECT * FROM pg_stat_activity')
ntuples = results.ntuples
warn("pg_stat_activity count: #{ntuples}")
if ntuples > warning_threshold
results.each do |result|
warn result.inspect
end
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment