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
ce054552
Commit
ce054552
authored
Apr 14, 2022
by
Eduardo Bonet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes counter name, improves testing
parent
353924ef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
lib/gitlab/diff/custom_diff.rb
lib/gitlab/diff/custom_diff.rb
+2
-2
spec/lib/gitlab/diff/custom_diff_spec.rb
spec/lib/gitlab/diff/custom_diff_spec.rb
+4
-2
No files found.
lib/gitlab/diff/custom_diff.rb
View file @
ce054552
...
...
@@ -65,7 +65,7 @@ module Gitlab
def
rendered_timeout
@rendered_timeout
||=
Gitlab
::
Metrics
.
counter
(
:
rendered_timeout
,
:
ipynb_semantic_diff_timeouts_total
,
'Counts the times notebook rendering timed out'
)
end
...
...
@@ -80,7 +80,7 @@ module Gitlab
def
log_event
(
message
,
error
=
nil
)
Gitlab
::
AppLogger
.
info
({
message:
message
})
Gitlab
::
ErrorTracking
.
log
_exception
(
error
)
if
error
Gitlab
::
ErrorTracking
.
track
_exception
(
error
)
if
error
nil
end
end
...
...
spec/lib/gitlab/diff/custom_diff_spec.rb
View file @
ce054552
...
...
@@ -53,8 +53,9 @@ RSpec.describe Gitlab::Diff::CustomDiff do
end
it
'increments metrics'
do
counter
=
Gitlab
::
Metrics
.
counter
(
:ipynb_semantic_diff_timeouts_total
,
'desc'
)
expect
(
Timeout
).
to
receive
(
:timeout
).
and_raise
(
Timeout
::
Error
)
counter
=
Gitlab
::
Metrics
.
counter
(
:rendered_timeout
,
'desc'
)
expect
{
subject
}.
to
change
{
counter
.
get
(
source:
described_class
::
FOREGROUND_EXECUTION
)
}.
by
(
1
)
end
end
...
...
@@ -71,8 +72,9 @@ RSpec.describe Gitlab::Diff::CustomDiff do
end
it
'increments metrics'
do
counter
=
Gitlab
::
Metrics
.
counter
(
:ipynb_semantic_diff_timeouts_total
,
'desc'
)
expect
(
Timeout
).
to
receive
(
:timeout
).
and_raise
(
Timeout
::
Error
)
counter
=
Gitlab
::
Metrics
.
counter
(
:rendered_timeout
,
'desc'
)
expect
{
subject
}.
to
change
{
counter
.
get
(
source:
described_class
::
BACKGROUND_EXECUTION
)
}.
by
(
1
)
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