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
faa85a41
Commit
faa85a41
authored
Jun 04, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move LB-related InstrumentationHelper specs to Core
This was missed from previous moves
parent
9ead4da9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
36 deletions
+36
-36
ee/spec/lib/gitlab/instrumentation_helper_spec.rb
ee/spec/lib/gitlab/instrumentation_helper_spec.rb
+0
-36
spec/lib/gitlab/instrumentation_helper_spec.rb
spec/lib/gitlab/instrumentation_helper_spec.rb
+36
-0
No files found.
ee/spec/lib/gitlab/instrumentation_helper_spec.rb
View file @
faa85a41
...
...
@@ -8,42 +8,6 @@ RSpec.describe Gitlab::InstrumentationHelper do
subject
{
described_class
.
add_instrumentation_data
(
payload
)
}
context
'when load balancing is enabled'
do
include_context
'clear DB Load Balancing configuration'
before
do
allow
(
Gitlab
::
Database
::
LoadBalancing
).
to
receive
(
:enable?
).
and_return
(
true
)
end
it
'includes DB counts'
do
subject
expect
(
payload
).
to
include
(
db_replica_count:
0
,
db_replica_cached_count:
0
,
db_primary_count:
0
,
db_primary_cached_count:
0
,
db_primary_wal_count:
0
,
db_replica_wal_count:
0
)
end
end
context
'when load balancing is disabled'
do
before
do
allow
(
Gitlab
::
Database
::
LoadBalancing
).
to
receive
(
:enable?
).
and_return
(
false
)
end
it
'does not include DB counts'
do
subject
expect
(
payload
).
not_to
include
(
db_replica_count:
0
,
db_replica_cached_count:
0
,
db_primary_count:
0
,
db_primary_cached_count:
0
,
db_primary_wal_count:
0
,
db_replica_wal_count:
0
)
end
end
# We don't want to interact with Elasticsearch in GitLab FOSS so we test
# this in ee/ only. The code exists in FOSS and won't do anything.
context
'when Elasticsearch calls are made'
,
:elastic
do
...
...
spec/lib/gitlab/instrumentation_helper_spec.rb
View file @
faa85a41
...
...
@@ -117,6 +117,42 @@ RSpec.describe Gitlab::InstrumentationHelper do
end
end
end
context
'when load balancing is enabled'
do
include_context
'clear DB Load Balancing configuration'
before
do
allow
(
Gitlab
::
Database
::
LoadBalancing
).
to
receive
(
:enable?
).
and_return
(
true
)
end
it
'includes DB counts'
do
subject
expect
(
payload
).
to
include
(
db_replica_count:
0
,
db_replica_cached_count:
0
,
db_primary_count:
0
,
db_primary_cached_count:
0
,
db_primary_wal_count:
0
,
db_replica_wal_count:
0
)
end
end
context
'when load balancing is disabled'
do
before
do
allow
(
Gitlab
::
Database
::
LoadBalancing
).
to
receive
(
:enable?
).
and_return
(
false
)
end
it
'does not include DB counts'
do
subject
expect
(
payload
).
not_to
include
(
db_replica_count:
0
,
db_replica_cached_count:
0
,
db_primary_count:
0
,
db_primary_cached_count:
0
,
db_primary_wal_count:
0
,
db_replica_wal_count:
0
)
end
end
end
describe
'.queue_duration_for_job'
do
...
...
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