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
ca854a2d
Commit
ca854a2d
authored
Apr 06, 2020
by
Allison Browne
Committed by
Peter Leitzen
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformat usage data for shorter lines
Change whitespace to allow for shorter lines to increase readability
parent
669d3c3f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
22 deletions
+65
-22
doc/user/admin_area/settings/usage_statistics.md
doc/user/admin_area/settings/usage_statistics.md
+2
-0
ee/app/models/ee/issue.rb
ee/app/models/ee/issue.rb
+1
-0
ee/changelogs/unreleased/207409-status-page-usage-ping.yml
ee/changelogs/unreleased/207409-status-page-usage-ping.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+25
-22
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+11
-0
ee/spec/models/issue_spec.rb
ee/spec/models/issue_spec.rb
+21
-0
No files found.
doc/user/admin_area/settings/usage_statistics.md
View file @
ca854a2d
...
...
@@ -327,6 +327,8 @@ but commented out to help encourage others to add to it in the future. -->
|dependency_scanning_jobs|counts||
|license_management_jobs|counts||
|sast_jobs|counts||
|status_page_projects|counts|monitor|
|status_page_issues|counts|monitor|
|epics_deepest_relationship_level|counts||
|operations_dashboard_default_dashboard|counts||
|operations_dashboard_users_with_projects_added|counts||
...
...
ee/app/models/ee/issue.rb
View file @
ca854a2d
...
...
@@ -25,6 +25,7 @@ module EE
issue_ids
=
EpicIssue
.
where
(
epic_id:
epics
).
select
(
:issue_id
)
id_in
(
issue_ids
)
end
scope
:on_status_page
,
->
{
joins
(
project: :status_page_setting
).
where
(
status_page_settings:
{
enabled:
true
}).
public_only
}
scope
:counts_by_health_status
,
->
{
reorder
(
nil
).
group
(
:health_status
).
count
}
has_one
:epic_issue
...
...
ee/changelogs/unreleased/207409-status-page-usage-ping.yml
0 → 100644
View file @
ca854a2d
---
title
:
Add Usage Ping For Status Page
merge_request
:
28002
author
:
type
:
added
ee/lib/ee/gitlab/usage_data.rb
View file @
ca854a2d
...
...
@@ -140,28 +140,31 @@ module EE
override
:system_usage_data
def
system_usage_data
super
.
tap
do
|
usage_data
|
usage_data
[
:counts
].
merge!
({
dependency_list_usages_total:
::
Gitlab
::
UsageCounters
::
DependencyList
.
usage_totals
[
:total
],
epics:
count
(
::
Epic
),
feature_flags:
count
(
Operations
::
FeatureFlag
),
geo_nodes:
count
(
::
GeoNode
),
ldap_group_links:
count
(
::
LdapGroupLink
),
ldap_keys:
count
(
::
LDAPKey
),
ldap_users:
count
(
::
User
.
ldap
,
'users.id'
),
pod_logs_usages_total:
::
Gitlab
::
UsageCounters
::
PodLogs
.
usage_totals
[
:total
],
projects_enforcing_code_owner_approval:
count
(
::
Project
.
without_deleted
.
non_archived
.
requiring_code_owner_approval
),
merge_requests_with_optional_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_optional
,
:merge_request_id
),
merge_requests_with_required_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_required
,
:merge_request_id
),
projects_mirrored_with_pipelines_enabled:
count
(
::
Project
.
mirrored_with_enabled_pipelines
),
projects_reporting_ci_cd_back_to_github:
count
(
::
GithubService
.
without_defaults
.
active
),
projects_with_packages:
distinct_count
(
::
Packages
::
Package
,
:project_id
),
projects_with_tracing_enabled:
count
(
ProjectTracingSetting
),
template_repositories:
count
(
::
Project
.
with_repos_templates
)
+
count
(
::
Project
.
with_groups_level_repos_templates
)
},
service_desk_counts
,
security_products_usage
,
epics_deepest_relationship_level
,
operations_dashboard_usage
)
usage_data
[
:counts
].
merge!
(
{
dependency_list_usages_total:
::
Gitlab
::
UsageCounters
::
DependencyList
.
usage_totals
[
:total
],
epics:
count
(
::
Epic
),
feature_flags:
count
(
Operations
::
FeatureFlag
),
geo_nodes:
count
(
::
GeoNode
),
ldap_group_links:
count
(
::
LdapGroupLink
),
ldap_keys:
count
(
::
LDAPKey
),
ldap_users:
count
(
::
User
.
ldap
,
'users.id'
),
pod_logs_usages_total:
::
Gitlab
::
UsageCounters
::
PodLogs
.
usage_totals
[
:total
],
projects_enforcing_code_owner_approval:
count
(
::
Project
.
without_deleted
.
non_archived
.
requiring_code_owner_approval
),
merge_requests_with_optional_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_optional
,
:merge_request_id
),
merge_requests_with_required_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_required
,
:merge_request_id
),
projects_mirrored_with_pipelines_enabled:
count
(
::
Project
.
mirrored_with_enabled_pipelines
),
projects_reporting_ci_cd_back_to_github:
count
(
::
GithubService
.
without_defaults
.
active
),
projects_with_packages:
distinct_count
(
::
Packages
::
Package
,
:project_id
),
projects_with_tracing_enabled:
count
(
ProjectTracingSetting
),
status_page_projects:
count
(
::
StatusPageSetting
.
enabled
),
status_page_issues:
count
(
::
Issue
.
on_status_page
),
template_repositories:
count
(
::
Project
.
with_repos_templates
)
+
count
(
::
Project
.
with_groups_level_repos_templates
)
},
service_desk_counts
,
security_products_usage
,
epics_deepest_relationship_level
,
operations_dashboard_usage
)
end
end
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
ca854a2d
...
...
@@ -41,6 +41,13 @@ describe Gitlab::UsageData do
# for group_view testing
create
(
:user
)
# user with group_view = NULL (should be counted as having default value 'details')
create
(
:user
,
group_view: :details
)
# Status Page
create
(
:status_page_setting
,
project:
projects
[
0
],
enabled:
true
)
create
(
:status_page_setting
,
project:
projects
[
1
],
enabled:
false
)
# 1 public issue on 1 projects with status page enabled
create
(
:issue
,
project:
projects
[
0
])
create
(
:issue
,
:confidential
,
project:
projects
[
0
])
end
subject
{
described_class
.
data
}
...
...
@@ -93,6 +100,8 @@ describe Gitlab::UsageData do
projects_with_prometheus_alerts
projects_with_tracing_enabled
sast_jobs
status_page_projects
status_page_issues
design_management_designs_create
design_management_designs_update
design_management_designs_delete
...
...
@@ -105,6 +114,8 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:projects_with_prometheus_alerts
]).
to
eq
(
2
)
expect
(
count_data
[
:projects_with_packages
]).
to
eq
(
2
)
expect
(
count_data
[
:feature_flags
]).
to
eq
(
1
)
expect
(
count_data
[
:status_page_projects
]).
to
eq
(
1
)
expect
(
count_data
[
:status_page_issues
]).
to
eq
(
1
)
end
it
'has integer value for epic relationship level'
do
...
...
ee/spec/models/issue_spec.rb
View file @
ca854a2d
...
...
@@ -77,6 +77,27 @@ describe Issue do
end
end
describe
'.on_status_page'
do
context
'with public issue and private issue'
do
let_it_be
(
:status_page_setting
)
{
create
(
:status_page_setting
,
enabled:
true
)
}
let_it_be
(
:public_issue
)
{
create
(
:issue
,
project:
status_page_setting
.
project
)
}
let_it_be
(
:private_issue
)
{
create
(
:issue
,
:confidential
,
project:
status_page_setting
.
project
)
}
it
{
expect
(
Issue
.
on_status_page
.
count
).
to
eq
(
1
)
}
it
{
expect
(
Issue
.
on_status_page
.
first
).
to
eq
(
public_issue
)
}
end
context
'with project status page settings enabled and disabled'
do
let_it_be
(
:status_page_setting_enabled
)
{
create
(
:status_page_setting
,
enabled:
true
)
}
let_it_be
(
:status_page_setting_disabled
)
{
create
(
:status_page_setting
,
enabled:
false
)
}
let_it_be
(
:issue_with_enabled_project
)
{
create
(
:issue
,
project:
status_page_setting_enabled
.
project
)
}
let_it_be
(
:issue_with_disabled_project
)
{
create
(
:issue
,
project:
status_page_setting_disabled
.
project
)
}
it
{
expect
(
Issue
.
on_status_page
.
count
).
to
eq
(
1
)
}
it
{
expect
(
Issue
.
on_status_page
.
first
).
to
eq
(
issue_with_enabled_project
)
}
end
end
context
'epics'
do
let_it_be
(
:epic1
)
{
create
(
:epic
)
}
let_it_be
(
:epic2
)
{
create
(
:epic
)
}
...
...
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