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
c6b7fd99
Commit
c6b7fd99
authored
Jul 07, 2020
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move verify stage usage activity to CE
Also updates the documentation
parent
3289352e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
49 deletions
+69
-49
changelogs/unreleased/217362-move-verify-stage-usage-activity-to-ce.yml
...eleased/217362-move-verify-stage-usage-activity-to-ce.yml
+5
-0
doc/development/telemetry/usage_ping.md
doc/development/telemetry/usage_ping.md
+10
-10
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+0
-9
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+2
-29
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+13
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+39
-0
No files found.
changelogs/unreleased/217362-move-verify-stage-usage-activity-to-ce.yml
0 → 100644
View file @
c6b7fd99
---
title
:
Move verify stage usage activity to CE
merge_request
:
36090
author
:
type
:
changed
doc/development/telemetry/usage_ping.md
View file @
c6b7fd99
...
...
@@ -678,16 +678,16 @@ appear to be associated to any of the services running, since they all appear to
|
`releases`
|
`usage_activity_by_stage`
|
`release`
| | CE+EE | Unique release tags in project |
|
`successful_deployments`
|
`usage_activity_by_stage`
|
`release`
| | CE+EE | Total successful deployments |
|
`user_preferences_group_overview_security_dashboard: 0`
|
`usage_activity_by_stage`
|
`secure`
| | | |
|
`ci_builds`
|
`usage_activity_by_stage`
|
`verify`
| |
| Unique builds in project |
|
`ci_external_pipelines`
|
`usage_activity_by_stage`
|
`verify`
| |
| Total pipelines in external repositories |
|
`ci_internal_pipelines`
|
`usage_activity_by_stage`
|
`verify`
| |
| Total pipelines in GitLab repositories |
|
`ci_pipeline_config_auto_devops`
|
`usage_activity_by_stage`
|
`verify`
| |
| Total pipelines from an Auto DevOps template |
|
`ci_pipeline_config_repository`
|
`usage_activity_by_stage`
|
`verify`
| |
| Pipelines from templates in repository |
|
`ci_pipeline_schedules`
|
`usage_activity_by_stage`
|
`verify`
| |
| Pipeline schedules in GitLab |
|
`ci_pipelines`
|
`usage_activity_by_stage`
|
`verify`
| |
| Total pipelines |
|
`ci_triggers`
|
`usage_activity_by_stage`
|
`verify`
| |
| Triggers enabled |
|
`clusters_applications_runner`
|
`usage_activity_by_stage`
|
`verify`
| |
| Unique clusters with Runner enabled |
|
`projects_reporting_ci_cd_back_to_github
: 0`
|
`usage_activity_by_stage`
|
`verify`
| |
| Unique projects with a GitHub pipeline enabled |
|
`ci_builds`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Unique builds in project |
|
`ci_external_pipelines`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Total pipelines in external repositories |
|
`ci_internal_pipelines`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Total pipelines in GitLab repositories |
|
`ci_pipeline_config_auto_devops`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Total pipelines from an Auto DevOps template |
|
`ci_pipeline_config_repository`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Pipelines from templates in repository |
|
`ci_pipeline_schedules`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Pipeline schedules in GitLab |
|
`ci_pipelines`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Total pipelines |
|
`ci_triggers`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Triggers enabled |
|
`clusters_applications_runner`
|
`usage_activity_by_stage`
|
`verify`
| |
CE+EE
| Unique clusters with Runner enabled |
|
`projects_reporting_ci_cd_back_to_github
`
|
`usage_activity_by_stage`
|
`verify`
| | EE
| Unique projects with a GitHub pipeline enabled |
|
`merge_requests_users`
|
`usage_activity_by_stage_monthly`
|
`create`
| | | Unique count of users who used a merge request |
|
`duration_s`
|
`topology`
|
`enablement`
| | | Time it took to collect topology data |
|
`application_requests_per_hour`
|
`topology`
|
`enablement`
| | | Number of requests to the web application per hour |
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
c6b7fd99
...
...
@@ -299,15 +299,6 @@ module EE
override
:usage_activity_by_stage_verify
def
usage_activity_by_stage_verify
(
time_period
)
super
.
merge
({
ci_builds:
distinct_count
(
::
Ci
::
Build
.
where
(
time_period
),
:user_id
),
ci_external_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
external
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_internal_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
internal
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_pipeline_config_auto_devops:
distinct_count
(
::
Ci
::
Pipeline
.
auto_devops_source
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_pipeline_config_repository:
distinct_count
(
::
Ci
::
Pipeline
.
repository_source
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_pipeline_schedules:
distinct_count
(
::
Ci
::
PipelineSchedule
.
where
(
time_period
),
:owner_id
),
ci_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_triggers:
distinct_count
(
::
Ci
::
Trigger
.
where
(
time_period
),
:owner_id
),
clusters_applications_runner:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
Runner
,
time_period
),
projects_reporting_ci_cd_back_to_github:
distinct_count
(
::
Project
.
with_github_service_pipeline_events
.
where
(
time_period
),
:creator_id
)
})
end
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
c6b7fd99
...
...
@@ -609,40 +609,13 @@ RSpec.describe Gitlab::UsageData do
context
'for verify'
do
it
'includes accurate usage_activity_by_stage data'
do
for_defined_days_back
do
user
=
create
(
:user
)
create
(
:ci_build
,
user:
user
)
create
(
:ci_empty_pipeline
,
source: :external
,
user:
user
)
create
(
:ci_empty_pipeline
,
user:
user
)
create
(
:ci_pipeline
,
:auto_devops_source
,
user:
user
)
create
(
:ci_pipeline
,
:repository_source
,
user:
user
)
create
(
:ci_pipeline_schedule
,
owner:
user
)
create
(
:ci_trigger
,
owner:
user
)
create
(
:clusters_applications_runner
,
:installed
)
create
(
:github_service
)
end
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:verify
]).
to
eq
(
ci_builds:
2
,
ci_external_pipelines:
2
,
ci_internal_pipelines:
2
,
ci_pipeline_config_auto_devops:
2
,
ci_pipeline_config_repository:
2
,
ci_pipeline_schedules:
2
,
ci_pipelines:
2
,
ci_triggers:
2
,
clusters_applications_runner:
2
,
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:verify
]).
to
include
(
projects_reporting_ci_cd_back_to_github:
2
)
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:verify
]).
to
eq
(
ci_builds:
1
,
ci_external_pipelines:
1
,
ci_internal_pipelines:
1
,
ci_pipeline_config_auto_devops:
1
,
ci_pipeline_config_repository:
1
,
ci_pipeline_schedules:
1
,
ci_pipelines:
1
,
ci_triggers:
1
,
clusters_applications_runner:
1
,
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:verify
]).
to
include
(
projects_reporting_ci_cd_back_to_github:
1
)
end
...
...
lib/gitlab/usage_data.rb
View file @
c6b7fd99
...
...
@@ -532,9 +532,21 @@ module Gitlab
# rubocop: enable CodeReuse/ActiveRecord
# Omitted because no user, creator or author associated: `ci_runners`
# rubocop: disable CodeReuse/ActiveRecord
def
usage_activity_by_stage_verify
(
time_period
)
{}
{
ci_builds:
distinct_count
(
::
Ci
::
Build
.
where
(
time_period
),
:user_id
),
ci_external_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
external
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_internal_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
internal
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_pipeline_config_auto_devops:
distinct_count
(
::
Ci
::
Pipeline
.
auto_devops_source
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_pipeline_config_repository:
distinct_count
(
::
Ci
::
Pipeline
.
repository_source
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_pipeline_schedules:
distinct_count
(
::
Ci
::
PipelineSchedule
.
where
(
time_period
),
:owner_id
),
ci_pipelines:
distinct_count
(
::
Ci
::
Pipeline
.
where
(
time_period
),
:user_id
,
start:
user_minimum_id
,
finish:
user_maximum_id
),
ci_triggers:
distinct_count
(
::
Ci
::
Trigger
.
where
(
time_period
),
:owner_id
),
clusters_applications_runner:
cluster_applications_user_distinct_count
(
::
Clusters
::
Applications
::
Runner
,
time_period
)
}
end
# rubocop: enable CodeReuse/ActiveRecord
# Currently too complicated and to get reliable counts for these stats:
# container_scanning_jobs, dast_jobs, dependency_scanning_jobs, license_management_jobs, sast_jobs, secret_detection_jobs
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
c6b7fd99
...
...
@@ -119,6 +119,45 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
]
end
end
context
'for verify'
do
it
'includes accurate usage_activity_by_stage data'
do
for_defined_days_back
do
user
=
create
(
:user
)
create
(
:ci_build
,
user:
user
)
create
(
:ci_empty_pipeline
,
source: :external
,
user:
user
)
create
(
:ci_empty_pipeline
,
user:
user
)
create
(
:ci_pipeline
,
:auto_devops_source
,
user:
user
)
create
(
:ci_pipeline
,
:repository_source
,
user:
user
)
create
(
:ci_pipeline_schedule
,
owner:
user
)
create
(
:ci_trigger
,
owner:
user
)
create
(
:clusters_applications_runner
,
:installed
)
end
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage
][
:verify
]).
to
include
(
ci_builds:
2
,
ci_external_pipelines:
2
,
ci_internal_pipelines:
2
,
ci_pipeline_config_auto_devops:
2
,
ci_pipeline_config_repository:
2
,
ci_pipeline_schedules:
2
,
ci_pipelines:
2
,
ci_triggers:
2
,
clusters_applications_runner:
2
)
expect
(
described_class
.
uncached_data
[
:usage_activity_by_stage_monthly
][
:verify
]).
to
include
(
ci_builds:
1
,
ci_external_pipelines:
1
,
ci_internal_pipelines:
1
,
ci_pipeline_config_auto_devops:
1
,
ci_pipeline_config_repository:
1
,
ci_pipeline_schedules:
1
,
ci_pipelines:
1
,
ci_triggers:
1
,
clusters_applications_runner:
1
)
end
end
end
context
'for create'
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