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
14f9744f
Commit
14f9744f
authored
Mar 04, 2020
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add changelog and update conditional
- changelog needed for changes like this - conditional not required
parent
c2a30862
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
ee/changelogs/unreleased/update-secure-usage-ping-to-be-able-to-determine-number-of-jobs-by-use.yml
...ge-ping-to-be-able-to-determine-number-of-jobs-by-use.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+4
-6
No files found.
ee/changelogs/unreleased/update-secure-usage-ping-to-be-able-to-determine-number-of-jobs-by-use.yml
0 → 100644
View file @
14f9744f
---
title
:
Add distinct user count of secure stage items to usage ping
merge_request
:
26194
author
:
type
:
added
ee/lib/ee/gitlab/usage_data.rb
View file @
14f9744f
...
...
@@ -29,7 +29,7 @@ module EE
# self hosted instances, prevent them from running on GitLab.com and allow instance maintainers
# to disable them via a feature flag.
return
super
if
(
::
Feature
.
disabled?
(
:usage_ping_batch_counter
)
&&
::
Gitlab
.
com?
)
||
::
Feature
.
disabled?
(
:usage_activity_by_stage
,
default_enabled:
true
)
::
Feature
.
disabled?
(
:usage_activity_by_stage
,
default_enabled:
true
)
if
::
Feature
.
disabled?
(
:usage_activity_by_stage_monthly
)
super
.
merge
(
usage_activity_by_stage
)
...
...
@@ -320,16 +320,14 @@ module EE
user_preferences_group_overview_security_dashboard:
count
(
::
User
.
active
.
group_view_security_dashboard
.
where
(
time_period
))
}
SECURE_PRODUCT_TYPES
.
each
_with_object
(
results
)
do
|
(
secure_type
,
type_with_name
),
respons
e
|
res
ponse
[
"
#{
prefix
}#{
type_with_name
}
"
.
to_sym
]
=
distinct_count
(
::
Ci
::
Build
.
where
(
name:
secure_type
).
where
(
time_period
),
:user_id
)
SECURE_PRODUCT_TYPES
.
each
do
|
secure_type
,
type_with_nam
e
|
res
ults
[
"
#{
prefix
}#{
type_with_name
}
"
.
to_sym
]
=
distinct_count
(
::
Ci
::
Build
.
where
(
name:
secure_type
).
where
(
time_period
),
:user_id
)
end
# handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
combined_license_key
=
"
#{
prefix
}
license_management_jobs"
.
to_sym
license_scan_count
=
results
.
delete
(
"
#{
prefix
}
license_scanning_jobs"
.
to_sym
)
if
license_scan_count
&&
results
[
combined_license_key
]
results
[
combined_license_key
]
+=
license_scan_count
end
results
[
combined_license_key
]
+=
license_scan_count
results
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