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
a8115b7c
Commit
a8115b7c
authored
Jul 08, 2020
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move plan stage usage activity to CE
Also updates the documentation
parent
7d7596f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
26 deletions
+57
-26
changelogs/unreleased/217362-move-plan-stage-usage-activity-to-ce.yml
...nreleased/217362-move-plan-stage-usage-activity-to-ce.yml
+5
-0
doc/development/telemetry/usage_ping.md
doc/development/telemetry/usage_ping.md
+13
-4
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-5
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+5
-16
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+8
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+25
-0
No files found.
changelogs/unreleased/217362-move-plan-stage-usage-activity-to-ce.yml
0 → 100644
View file @
a8115b7c
---
title
:
Move plan stage usage activity to CE
merge_request
:
36087
author
:
type
:
changed
doc/development/telemetry/usage_ping.md
View file @
a8115b7c
...
...
@@ -681,10 +681,19 @@ appear to be associated to any of the services running, since they all appear to
|
`ldap_group_sync_enabled`
|
`usage_activity_by_stage`
|
`manage`
| | EE | |
|
`ldap_admin_sync_enabled`
|
`usage_activity_by_stage`
|
`manage`
| | EE | |
|
`group_saml_enabled`
|
`usage_activity_by_stage`
|
`manage`
| | EE | |
|
`projects_jira_dvcs_server_active`
|
`usage_activity_by_stage`
|
`plan`
| | | |
|
`service_desk_enabled_projects`
|
`usage_activity_by_stage`
|
`plan`
| | | |
|
`service_desk_issues`
|
`usage_activity_by_stage`
|
`plan`
| | | |
|
`todos: 0`
|
`usage_activity_by_stage`
|
`plan`
| | | |
|
`issues`
|
`usage_activity_by_stage`
|
`plan`
| | CE+EE | |
|
`notes`
|
`usage_activity_by_stage`
|
`plan`
| | CE+EE | |
|
`projects`
|
`usage_activity_by_stage`
|
`plan`
| | CE+EE | |
|
`todos`
|
`usage_activity_by_stage`
|
`plan`
| | CE+EE | |
|
`assignee_lists`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`epics`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`label_lists`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`milestone_lists`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`projects_jira_active`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`projects_jira_dvcs_server_active`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`projects_jira_dvcs_server_active`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`service_desk_enabled_projects`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`service_desk_issues`
|
`usage_activity_by_stage`
|
`plan`
| | EE | |
|
`deployments`
|
`usage_activity_by_stage`
|
`release`
| | CE+EE | Total deployments |
|
`failed_deployments`
|
`usage_activity_by_stage`
|
`release`
| | CE+EE | Total failed deployments |
|
`projects_mirrored_with_pipelines_enabled`
|
`usage_activity_by_stage`
|
`release`
| | EE | Projects with repository mirroring enabled |
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
a8115b7c
...
...
@@ -266,17 +266,13 @@ module EE
super
.
merge
({
assignee_lists:
distinct_count
(
::
List
.
assignee
.
where
(
time_period
),
:user_id
),
epics:
distinct_count
(
::
Epic
.
where
(
time_period
),
:author_id
),
issues:
distinct_count
(
::
Issue
.
where
(
time_period
),
:author_id
),
label_lists:
distinct_count
(
::
List
.
label
.
where
(
time_period
),
:user_id
),
milestone_lists:
distinct_count
(
::
List
.
milestone
.
where
(
time_period
),
:user_id
),
notes:
distinct_count
(
::
Note
.
where
(
time_period
),
:author_id
),
projects:
distinct_count
(
::
Project
.
where
(
time_period
),
:creator_id
),
projects_jira_active:
distinct_count
(
::
Project
.
with_active_jira_services
.
where
(
time_period
),
:creator_id
),
projects_jira_dvcs_cloud_active:
distinct_count
(
::
Project
.
with_active_jira_services
.
with_jira_dvcs_cloud
.
where
(
time_period
),
:creator_id
),
projects_jira_dvcs_server_active:
distinct_count
(
::
Project
.
with_active_jira_services
.
with_jira_dvcs_server
.
where
(
time_period
),
:creator_id
),
service_desk_enabled_projects:
distinct_count_service_desk_enabled_projects
(
time_period
),
service_desk_issues:
count
(
::
Issue
.
service_desk
.
where
(
time_period
)),
todos:
distinct_count
(
::
Todo
.
where
(
time_period
),
:author_id
)
service_desk_issues:
count
(
::
Issue
.
service_desk
.
where
(
time_period
))
})
end
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
a8115b7c
...
...
@@ -442,48 +442,37 @@ RSpec.describe Gitlab::UsageData do
for_defined_days_back
do
user
=
create
(
:user
)
project
=
create
(
:project
,
creator:
user
)
issue
=
create
(
:issue
,
project:
project
,
author:
User
.
support_bot
)
create
(
:issue
,
project:
project
,
author:
user
)
create
(
:issue
,
project:
project
,
author:
User
.
support_bot
)
board
=
create
(
:board
,
project:
project
)
create
(
:user_list
,
board:
board
,
user:
user
)
create
(
:milestone_list
,
board:
board
,
milestone:
create
(
:milestone
,
project:
project
),
user:
user
)
create
(
:list
,
board:
board
,
label:
create
(
:label
,
project:
project
),
user:
user
)
create
(
:note
,
project:
project
,
noteable:
issue
,
author:
user
)
create
(
:epic
,
author:
user
)
create
(
:todo
,
project:
project
,
target:
issue
,
author:
user
)
create
(
:jira_service
,
:jira_cloud_service
,
active:
true
,
project:
create
(
:project
,
:jira_dvcs_cloud
,
creator:
user
))
create
(
:jira_service
,
active:
true
,
project:
create
(
:project
,
:jira_dvcs_server
,
creator:
user
))
end
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:plan
]).
to
eq
(
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:plan
]).
to
include
(
assignee_lists:
2
,
epics:
2
,
issues:
3
,
label_lists:
2
,
milestone_lists:
2
,
notes:
2
,
projects:
2
,
projects_jira_active:
2
,
projects_jira_dvcs_cloud_active:
2
,
projects_jira_dvcs_server_active:
2
,
service_desk_enabled_projects:
2
,
service_desk_issues:
2
,
todos:
2
service_desk_issues:
2
)
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:plan
]).
to
eq
(
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:plan
]).
to
include
(
assignee_lists:
1
,
epics:
1
,
issues:
2
,
label_lists:
1
,
milestone_lists:
1
,
notes:
1
,
projects:
1
,
projects_jira_active:
1
,
projects_jira_dvcs_cloud_active:
1
,
projects_jira_dvcs_server_active:
1
,
service_desk_enabled_projects:
1
,
service_desk_issues:
1
,
todos:
1
service_desk_issues:
1
)
end
end
...
...
lib/gitlab/usage_data.rb
View file @
a8115b7c
...
...
@@ -525,9 +525,16 @@ module Gitlab
# Omitted because no user, creator or author associated: `boards`, `labels`, `milestones`, `uploads`
# Omitted because too expensive: `epics_deepest_relationship_level`
# Omitted because of encrypted properties: `projects_jira_cloud_active`, `projects_jira_server_active`
# rubocop: disable CodeReuse/ActiveRecord
def
usage_activity_by_stage_plan
(
time_period
)
{}
{
issues:
distinct_count
(
::
Issue
.
where
(
time_period
),
:author_id
),
notes:
distinct_count
(
::
Note
.
where
(
time_period
),
:author_id
),
projects:
distinct_count
(
::
Project
.
where
(
time_period
),
:creator_id
),
todos:
distinct_count
(
::
Todo
.
where
(
time_period
),
:author_id
)
}
end
# rubocop: enable CodeReuse/ActiveRecord
# Omitted because no user, creator or author associated: `environments`, `feature_flags`, `in_review_folder`, `pages_domains`
# rubocop: disable CodeReuse/ActiveRecord
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
a8115b7c
...
...
@@ -235,6 +235,31 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
end
context
'for plan'
do
it
'includes accurate usage_activity_by_stage data'
do
for_defined_days_back
do
user
=
create
(
:user
)
project
=
create
(
:project
,
creator:
user
)
issue
=
create
(
:issue
,
project:
project
,
author:
user
)
create
(
:note
,
project:
project
,
noteable:
issue
,
author:
user
)
create
(
:todo
,
project:
project
,
target:
issue
,
author:
user
)
end
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:plan
]).
to
include
(
issues:
2
,
notes:
2
,
projects:
2
,
todos:
2
)
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:plan
]).
to
include
(
issues:
1
,
notes:
1
,
projects:
1
,
todos:
1
)
end
end
context
'for release'
do
it
'includes accurate usage_activity_by_stage data'
do
for_defined_days_back
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