Commit 2dc019ff authored by Etienne Baqué's avatar Etienne Baqué

Merge branch '322099-harden-addition-for-template-repositoriu' into 'master'

Harden  added metrics

See merge request gitlab-org/gitlab!54805
parents 341d0e2f 8893a669
---
title: Harden added metrics
merge_request: 54805
author:
type: performance
...@@ -209,7 +209,7 @@ module EE ...@@ -209,7 +209,7 @@ module EE
projects_reporting_ci_cd_back_to_github: count(::GithubService.active), projects_reporting_ci_cd_back_to_github: count(::GithubService.active),
status_page_projects: count(::StatusPage::ProjectSetting.enabled), status_page_projects: count(::StatusPage::ProjectSetting.enabled),
status_page_issues: count(::Issue.on_status_page, start: issue_minimum_id, finish: issue_maximum_id), 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) template_repositories: add(count(::Project.with_repos_templates), count(::Project.with_groups_level_repos_templates))
}, },
requirements_counts, requirements_counts,
security_products_usage, security_products_usage,
......
...@@ -192,7 +192,7 @@ module Gitlab ...@@ -192,7 +192,7 @@ module Gitlab
container_expiration_policies_usage, container_expiration_policies_usage,
service_desk_counts service_desk_counts
).tap do |data| ).tap do |data|
data[:snippets] = data[:personal_snippets] + data[:project_snippets] data[:snippets] = add(data[:personal_snippets], data[:project_snippets])
end end
} }
end end
...@@ -227,7 +227,7 @@ module Gitlab ...@@ -227,7 +227,7 @@ module Gitlab
snowplow_event_counts(last_28_days_time_period(column: :collector_tstamp)), snowplow_event_counts(last_28_days_time_period(column: :collector_tstamp)),
aggregated_metrics_monthly aggregated_metrics_monthly
).tap do |data| ).tap do |data|
data[:snippets] = data[:personal_snippets] + data[:project_snippets] data[:snippets] = add(data[:personal_snippets], data[:project_snippets])
end end
} }
end end
...@@ -821,11 +821,9 @@ module Gitlab ...@@ -821,11 +821,9 @@ module Gitlab
def total_alert_issues def total_alert_issues
# Remove prometheus table queries once they are deprecated # Remove prometheus table queries once they are deprecated
# To be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/217407. # To be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/217407.
[ add count(Issue.with_alert_management_alerts, start: issue_minimum_id, finish: issue_maximum_id),
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_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) count(::Issue.with_prometheus_alert_events, start: issue_minimum_id, finish: issue_maximum_id)
].reduce(:+)
end end
def user_minimum_id def user_minimum_id
...@@ -952,7 +950,7 @@ module Gitlab ...@@ -952,7 +950,7 @@ module Gitlab
csv_issue_imports = distinct_count(Issues::CsvImport.where(time_period), :user_id) csv_issue_imports = distinct_count(Issues::CsvImport.where(time_period), :user_id)
group_imports = distinct_count(::GroupImportState.where(time_period), :user_id) group_imports = distinct_count(::GroupImportState.where(time_period), :user_id)
project_imports + bulk_imports + jira_issue_imports + csv_issue_imports + group_imports add(project_imports, bulk_imports, jira_issue_imports, csv_issue_imports, group_imports)
end end
# rubocop:enable CodeReuse/ActiveRecord # rubocop:enable CodeReuse/ActiveRecord
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment