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
b244314f
Commit
b244314f
authored
Oct 15, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify that usage ping works when all counts time out
parent
0ec8038a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+7
-0
No files found.
ee/lib/ee/gitlab/usage_data.rb
View file @
b244314f
...
@@ -83,7 +83,7 @@ module EE
...
@@ -83,7 +83,7 @@ module EE
sast: :sast_jobs
sast: :sast_jobs
}
}
results
=
count
(
::
Ci
::
Build
.
where
(
name:
types
.
keys
).
group
(
:name
))
results
=
count
(
::
Ci
::
Build
.
where
(
name:
types
.
keys
).
group
(
:name
)
,
fallback:
Hash
.
new
(
-
1
)
)
results
.
each_with_object
({})
{
|
(
key
,
value
),
response
|
response
[
types
[
key
.
to_sym
]]
=
value
}
results
.
each_with_object
({})
{
|
(
key
,
value
),
response
|
response
[
types
[
key
.
to_sym
]]
=
value
}
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: enable CodeReuse/ActiveRecord
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
b244314f
...
@@ -128,6 +128,13 @@ describe Gitlab::UsageData do
...
@@ -128,6 +128,13 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:clusters_applications_prometheus
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_prometheus
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_runner
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_runner
]).
to
eq
(
1
)
end
end
it
'works when queries time out'
do
allow_any_instance_of
(
ActiveRecord
::
Relation
)
.
to
receive
(
:count
).
and_raise
(
ActiveRecord
::
StatementInvalid
.
new
(
''
))
expect
{
subject
}.
not_to
raise_error
end
end
end
describe
'#features_usage_data_ce'
do
describe
'#features_usage_data_ce'
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