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
0afe2462
Commit
0afe2462
authored
Oct 30, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move projects_with_error_tracking_enabled to Core
Move `projects_with_error_tracking_enabled` metric from EE to CE
parent
fa312dfb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
app/models/project.rb
app/models/project.rb
+1
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+0
-1
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+0
-1
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+0
-3
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+5
-2
No files found.
app/models/project.rb
View file @
0afe2462
...
...
@@ -571,6 +571,7 @@ class Project < ApplicationRecord
scope
:imported_from
,
->
(
type
)
{
where
(
import_type:
type
)
}
scope
:with_tracing_enabled
,
->
{
joins
(
:tracing_setting
)
}
scope
:with_enabled_error_tracking
,
->
{
joins
(
:error_tracking_setting
).
where
(
project_error_tracking_settings:
{
enabled:
true
})
}
enum
auto_cancel_pending_pipelines:
{
disabled:
0
,
enabled:
1
}
...
...
ee/app/models/ee/project.rb
View file @
0afe2462
...
...
@@ -134,7 +134,6 @@ module EE
scope
:with_security_reports
,
->
{
where
(
'EXISTS (?)'
,
::
Ci
::
JobArtifact
.
security_reports
.
scoped_project
.
select
(
1
))
}
scope
:with_github_service_pipeline_events
,
->
{
joins
(
:github_service
).
merge
(
GithubService
.
pipeline_hooks
)
}
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_enabled_incident_sla
,
->
{
joins
(
:incident_management_setting
).
where
(
project_incident_management_settings:
{
sla_timer:
true
})
}
scope
:mirrored_with_enabled_pipelines
,
->
do
joins
(
:project_feature
).
mirror
.
where
(
mirror_trigger_builds:
true
,
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
0afe2462
...
...
@@ -294,7 +294,6 @@ module EE
super
.
merge
({
operations_dashboard_users_with_projects_added:
distinct_count
(
UsersOpsDashboardProject
.
joins
(
:user
).
merge
(
::
User
.
active
).
where
(
time_period
),
:user_id
),
projects_prometheus_active:
distinct_count
(
::
Project
.
with_active_prometheus_service
.
where
(
time_period
),
:creator_id
),
projects_with_error_tracking_enabled:
distinct_count
(
::
Project
.
with_enabled_error_tracking
.
where
(
time_period
),
:creator_id
),
projects_incident_sla_enabled:
count
(
::
Project
.
with_enabled_incident_sla
)
})
end
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
0afe2462
...
...
@@ -436,20 +436,17 @@ RSpec.describe Gitlab::UsageData do
project
=
create
(
:project
,
creator:
user
)
create
(
:users_ops_dashboard_project
,
user:
user
)
create
(
:prometheus_service
,
project:
project
)
create
(
:project_error_tracking_setting
,
project:
project
)
create
(
:project_incident_management_setting
,
:sla_enabled
,
project:
project
)
end
expect
(
described_class
.
usage_activity_by_stage_monitor
({})).
to
include
(
operations_dashboard_users_with_projects_added:
2
,
projects_prometheus_active:
2
,
projects_with_error_tracking_enabled:
2
,
projects_incident_sla_enabled:
2
)
expect
(
described_class
.
usage_activity_by_stage_monitor
(
described_class
.
last_28_days_time_period
)).
to
include
(
operations_dashboard_users_with_projects_added:
1
,
projects_prometheus_active:
1
,
projects_with_error_tracking_enabled:
1
,
projects_incident_sla_enabled:
2
)
end
...
...
lib/gitlab/usage_data.rb
View file @
0afe2462
...
...
@@ -617,7 +617,8 @@ module Gitlab
operations_dashboard_default_dashboard:
count
(
::
User
.
active
.
with_dashboard
(
'operations'
).
where
(
time_period
),
start:
user_minimum_id
,
finish:
user_maximum_id
),
projects_with_tracing_enabled:
distinct_count
(
::
Project
.
with_tracing_enabled
.
where
(
time_period
),
:creator_id
)
projects_with_tracing_enabled:
distinct_count
(
::
Project
.
with_tracing_enabled
.
where
(
time_period
),
:creator_id
),
projects_with_error_tracking_enabled:
distinct_count
(
::
Project
.
with_enabled_error_tracking
.
where
(
time_period
),
:creator_id
)
}
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
0afe2462
...
...
@@ -294,19 +294,22 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
create
(
:project
,
creator:
user
)
create
(
:clusters_applications_prometheus
,
:installed
,
cluster:
cluster
)
create
(
:project_tracing_setting
)
create
(
:project_error_tracking_setting
)
end
expect
(
described_class
.
usage_activity_by_stage_monitor
({})).
to
include
(
clusters:
2
,
clusters_applications_prometheus:
2
,
operations_dashboard_default_dashboard:
2
,
projects_with_tracing_enabled:
2
projects_with_tracing_enabled:
2
,
projects_with_error_tracking_enabled:
2
)
expect
(
described_class
.
usage_activity_by_stage_monitor
(
described_class
.
last_28_days_time_period
)).
to
include
(
clusters:
1
,
clusters_applications_prometheus:
1
,
operations_dashboard_default_dashboard:
1
,
projects_with_tracing_enabled:
1
projects_with_tracing_enabled:
1
,
projects_with_error_tracking_enabled:
1
)
end
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