Commit 6448f2b7 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '223709-harden-counts-issues_with_health_status' into 'master'

Optimize issues_with_health_status usage ping counter

Closes #223709

See merge request gitlab-org/gitlab!35298
parents a16717a8 4f6b76bf
---
title: Optimize issues_with_health_status usage ping counter
merge_request: 35298
author:
type: performance
......@@ -161,7 +161,7 @@ module EE
geo_nodes: count(::GeoNode),
geo_event_log_max_id: alt_usage_data { Geo::EventLog.maximum(:id) || 0 },
ldap_group_links: count(::LdapGroupLink),
issues_with_health_status: count(::Issue.with_health_status),
issues_with_health_status: count(::Issue.with_health_status, start: issue_minimum_id, finish: issue_maximum_id),
ldap_keys: count(::LDAPKey),
ldap_users: count(::User.ldap, 'users.id'),
pod_logs_usages_total: redis_usage_data { ::Gitlab::UsageCounters::PodLogs.usage_totals[:total] },
......
......@@ -558,6 +558,18 @@ module Gitlab
end
end
def issue_minimum_id
strong_memoize(:issue_minimum_id) do
::Issue.minimum(:id)
end
end
def issue_maximum_id
strong_memoize(:issue_maximum_id) do
::Issue.maximum(:id)
end
end
def clear_memoized
clear_memoization(:user_minimum_id)
clear_memoization(:user_maximum_id)
......
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