Commit 4f6b76bf authored by Alishan Ladhani's avatar Alishan Ladhani

Harden issues_with_health_status counter

parent 31bed4c0
---
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] },
......
......@@ -564,6 +564,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