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
f7a590dd
Commit
f7a590dd
authored
Jun 25, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove check if db_duration_s is present
- Fix specs for lograge
parent
82142591
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
13 deletions
+2
-13
config/initializers/lograge.rb
config/initializers/lograge.rb
+1
-1
spec/initializers/lograge_spec.rb
spec/initializers/lograge_spec.rb
+1
-12
No files found.
config/initializers/lograge.rb
View file @
f7a590dd
...
...
@@ -15,7 +15,7 @@ unless Gitlab::Runtime.sidekiq?
data
[
:db_duration_s
]
=
Gitlab
::
Utils
.
ms_to_round_sec
(
data
.
delete
(
:db
))
if
data
[
:db
]
data
[
:view_duration_s
]
=
Gitlab
::
Utils
.
ms_to_round_sec
(
data
.
delete
(
:view
))
if
data
[
:view
]
data
[
:duration_s
]
=
Gitlab
::
Utils
.
ms_to_round_sec
(
data
.
delete
(
:duration
))
if
data
[
:duration
]
data
.
merge!
(
::
Gitlab
::
Metrics
::
Subscribers
::
ActiveRecord
.
db_counter_payload
)
if
data
[
:db_duration_s
]
data
.
merge!
(
::
Gitlab
::
Metrics
::
Subscribers
::
ActiveRecord
.
db_counter_payload
)
data
end
...
...
spec/initializers/lograge_spec.rb
View file @
f7a590dd
...
...
@@ -169,22 +169,11 @@ RSpec.describe 'lograge', type: :request do
expect
(
log_data
).
to
include
(
"db_count"
=>
1
,
"db_write_count"
=>
0
,
"db_cached_count"
=>
0
)
end
end
context
'with db payload'
do
before
do
event
.
payload
.
except!
(
:db_runtime
)
end
it
'does not include db counters'
,
:request_store
do
subscriber
.
process_action
(
event
)
expect
(
log_data
).
not_to
include
(
"db_count"
=>
0
,
"db_write_count"
=>
0
,
"db_cached_count"
=>
0
)
end
end
end
context
'when RequestStore is disabled'
do
context
'with db payload'
do
it
'
includes
db counters'
do
it
'
does not include
db counters'
do
ActiveRecord
::
Base
.
connection
.
execute
(
'SELECT pg_sleep(0.1);'
)
subscriber
.
process_action
(
event
)
...
...
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