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
903b4642
Commit
903b4642
authored
Mar 02, 2021
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use track_and_raise_for_dev_exception
parent
6b32393d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
lib/gitlab/usage_data_counters/hll_redis_counter.rb
lib/gitlab/usage_data_counters/hll_redis_counter.rb
+1
-1
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
.../lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
+1
-1
No files found.
lib/gitlab/usage_data_counters/hll_redis_counter.rb
View file @
903b4642
...
...
@@ -127,7 +127,7 @@ module Gitlab
return
unless
Gitlab
::
CurrentSettings
.
usage_ping_enabled?
event
=
event_for
(
event_name
)
raise
UnknownEvent
,
"Unknown event
#{
event_name
}
"
unless
event
.
present?
Gitlab
::
ErrorTracking
.
track_and_raise_for_dev_exception
(
UnknownEvent
.
new
(
"Unknown event
#{
event_name
}
"
))
unless
event
.
present?
return
unless
feature_enabled?
(
event
)
...
...
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
View file @
903b4642
...
...
@@ -150,7 +150,7 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
expect
{
described_class
.
track_event
(
different_aggregation
,
values:
entity1
,
time:
Date
.
current
)
}.
to
raise_error
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
::
UnknownAggregation
)
end
it
'raise error if metrics of unknown
aggregation
'
do
it
'raise error if metrics of unknown
event
'
do
expect
{
described_class
.
track_event
(
'unknown'
,
values:
entity1
,
time:
Date
.
current
)
}.
to
raise_error
(
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
::
UnknownEvent
)
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