Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f164be45
Commit
f164be45
authored
Mar 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
9f17ced0
b923d1b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
spec/support/pg_stat_activity.rb
spec/support/pg_stat_activity.rb
+19
-0
No files found.
spec/support/pg_stat_activity.rb
0 → 100644
View file @
f164be45
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment