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
9fc7fa72
Commit
9fc7fa72
authored
Jul 16, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use memoized start/finish for metrics based on issues table
parent
39b70204
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
changelogs/unreleased/224602-optimize-usage-ping-metrics-based-on-issues-table.yml
...602-optimize-usage-ping-metrics-based-on-issues-table.yml
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+4
-2
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+7
-7
No files found.
changelogs/unreleased/224602-optimize-usage-ping-metrics-based-on-issues-table.yml
0 → 100644
View file @
9fc7fa72
---
title
:
Use memoized start/finish for metrics based on issues table
merge_request
:
37155
author
:
type
:
performance
ee/lib/ee/gitlab/usage_data.rb
View file @
9fc7fa72
...
...
@@ -115,7 +115,9 @@ module EE
project:
projects_with_service_desk
,
author:
::
User
.
support_bot
,
confidential:
true
)
),
start:
issue_minimum_id
,
finish:
issue_maximum_id
)
}
end
...
...
@@ -189,7 +191,7 @@ module EE
projects_with_packages:
distinct_count
(
::
Packages
::
Package
,
:project_id
),
projects_with_tracing_enabled:
count
(
ProjectTracingSetting
),
status_page_projects:
count
(
::
StatusPage
::
ProjectSetting
.
enabled
),
status_page_issues:
count
(
::
Issue
.
on_status_page
),
status_page_issues:
count
(
::
Issue
.
on_status_page
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
),
template_repositories:
count
(
::
Project
.
with_repos_templates
)
+
count
(
::
Project
.
with_groups_level_repos_templates
)
},
requirements_counts
,
...
...
lib/gitlab/usage_data.rb
View file @
9fc7fa72
...
...
@@ -66,8 +66,8 @@ module Gitlab
# rubocop: disable Metrics/AbcSize
# rubocop: disable CodeReuse/ActiveRecord
def
system_usage_data
alert_bot_incident_count
=
count
(
::
Issue
.
authored
(
::
User
.
alert_bot
))
issues_created_manually_from_alerts
=
count
(
Issue
.
with_alert_management_alerts
.
not_authored_by
(
::
User
.
alert_bot
))
alert_bot_incident_count
=
count
(
::
Issue
.
authored
(
::
User
.
alert_bot
)
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
)
issues_created_manually_from_alerts
=
count
(
Issue
.
with_alert_management_alerts
.
not_authored_by
(
::
User
.
alert_bot
)
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
)
{
counts:
{
...
...
@@ -114,7 +114,7 @@ module Gitlab
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
grafana_integrated_projects:
count
(
GrafanaIntegration
.
enabled
),
groups:
count
(
Group
),
issues:
count
(
Issue
),
issues:
count
(
Issue
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
),
issues_created_from_gitlab_error_tracking_ui:
count
(
SentryIssue
),
issues_with_associated_zoom_link:
count
(
ZoomMeeting
.
added_to_issue
),
issues_using_zoom_quick_actions:
distinct_count
(
ZoomMeeting
,
:issue_id
),
...
...
@@ -124,7 +124,7 @@ module Gitlab
issues_created_manually_from_alerts:
issues_created_manually_from_alerts
,
incident_issues:
alert_bot_incident_count
,
alert_bot_incident_issues:
alert_bot_incident_count
,
incident_labeled_issues:
count
(
::
Issue
.
with_label_attributes
(
::
IncidentManagement
::
CreateIncidentLabelService
::
LABEL_PROPERTIES
)),
incident_labeled_issues:
count
(
::
Issue
.
with_label_attributes
(
::
IncidentManagement
::
CreateIncidentLabelService
::
LABEL_PROPERTIES
)
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
),
keys:
count
(
Key
),
label_lists:
count
(
List
.
label
),
lfs_objects:
count
(
LfsObject
),
...
...
@@ -630,9 +630,9 @@ module Gitlab
# Remove prometheus table queries once they are deprecated
# To be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/217407.
[
count
(
Issue
.
with_alert_management_alerts
),
count
(
::
Issue
.
with_self_managed_prometheus_alert_events
),
count
(
::
Issue
.
with_prometheus_alert_events
)
count
(
Issue
.
with_alert_management_alerts
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
),
count
(
::
Issue
.
with_self_managed_prometheus_alert_events
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
),
count
(
::
Issue
.
with_prometheus_alert_events
,
start:
issue_minimum_id
,
finish:
issue_maximum_id
)
].
reduce
(:
+
)
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