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
4ed16b49
Commit
4ed16b49
authored
Oct 03, 2019
by
Alex Buijs
Committed by
Mayra Cabrera
Oct 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage statistics data for package stage
Added usage activity data for package stage
parent
24a05675
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+1
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+7
-0
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+10
-0
No files found.
ee/app/models/ee/project.rb
View file @
4ed16b49
...
...
@@ -122,6 +122,7 @@ module EE
scope
:with_active_prometheus_service
,
->
{
joins
(
:prometheus_service
).
merge
(
PrometheusService
.
active
)
}
scope
:with_enabled_error_tracking
,
->
{
joins
(
:error_tracking_setting
).
where
(
project_error_tracking_settings:
{
enabled:
true
})
}
scope
:with_tracing_enabled
,
->
{
joins
(
:tracing_setting
)
}
scope
:with_packages
,
->
{
joins
(
:packages
)
}
delegate
:shared_runners_minutes
,
:shared_runners_seconds
,
:shared_runners_seconds_last_reset
,
to: :statistics
,
allow_nil:
true
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
4ed16b49
...
...
@@ -186,6 +186,7 @@ module EE
create:
usage_activity_by_stage_create
,
manage:
usage_activity_by_stage_manage
,
monitor:
usage_activity_by_stage_monitor
,
package:
usage_activity_by_stage_package
,
plan:
usage_activity_by_stage_plan
,
verify:
usage_activity_by_stage_verify
}
...
...
@@ -229,6 +230,12 @@ module EE
}
end
def
usage_activity_by_stage_package
{
projects_with_packages:
::
Project
.
with_packages
.
distinct_count_by
(
:creator_id
)
}
end
# 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`
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
4ed16b49
...
...
@@ -107,6 +107,16 @@ describe Gitlab::UsageData do
end
end
context
'for package'
do
it
'includes accurate usage_activity_by_stage data'
do
create
(
:project
,
packages:
[
create
(
:package
)]
)
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:package
]).
to
eq
(
projects_with_packages:
1
)
end
end
context
'for plan'
do
it
'includes accurate usage_activity_by_stage data'
do
stub_licensed_features
(
board_assignee_lists:
true
,
board_milestone_lists:
true
)
...
...
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