Commit 8e151a79 authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch '212962-cluster-distinct_by_user-to-move-to-batch-counting-cert-manager' into 'master'

Move clusters_applications_cert_managers to batch counting

See merge request gitlab-org/gitlab!28771
parents 6aae7d57 05c6c63a
---
title: Move Clusters Application CertManager to batch counting
merge_request: 28771
author:
type: performance
...@@ -202,7 +202,7 @@ module EE ...@@ -202,7 +202,7 @@ module EE
# rubocop:disable CodeReuse/ActiveRecord # rubocop:disable CodeReuse/ActiveRecord
def usage_activity_by_stage_configure(time_period) def usage_activity_by_stage_configure(time_period)
{ {
clusters_applications_cert_managers: ::Clusters::Applications::CertManager.where(time_period).distinct_by_user, clusters_applications_cert_managers: distinct_count(::Clusters::Applications::CertManager.where(time_period).available.joins(:cluster), 'clusters.user_id'),
clusters_applications_helm: ::Clusters::Applications::Helm.where(time_period).distinct_by_user, clusters_applications_helm: ::Clusters::Applications::Helm.where(time_period).distinct_by_user,
clusters_applications_ingress: ::Clusters::Applications::Ingress.where(time_period).distinct_by_user, clusters_applications_ingress: ::Clusters::Applications::Ingress.where(time_period).distinct_by_user,
clusters_applications_knative: ::Clusters::Applications::Knative.where(time_period).distinct_by_user, clusters_applications_knative: ::Clusters::Applications::Knative.where(time_period).distinct_by_user,
......
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