Commit e9b01a68 authored by Alper Akgun's avatar Alper Akgun

Harden operations dashboard default dashboard

Optimize Usage data query with start and finish params
parent c2fc5a4b
---
title: Harden operations_dashboard_default_dashboard usage query
merge_request: 33952
author:
type: performance
...@@ -290,7 +290,9 @@ module EE ...@@ -290,7 +290,9 @@ module EE
{ {
clusters: distinct_count(::Clusters::Cluster.where(time_period), :user_id), clusters: distinct_count(::Clusters::Cluster.where(time_period), :user_id),
clusters_applications_prometheus: cluster_applications_user_distinct_count(::Clusters::Applications::Prometheus, time_period), clusters_applications_prometheus: cluster_applications_user_distinct_count(::Clusters::Applications::Prometheus, time_period),
operations_dashboard_default_dashboard: count(::User.active.with_dashboard('operations').where(time_period)), operations_dashboard_default_dashboard: count(::User.active.with_dashboard('operations').where(time_period),
start: user_minimum_id,
finish: user_maximum_id),
operations_dashboard_users_with_projects_added: distinct_count(UsersOpsDashboardProject.joins(:user).merge(::User.active).where(time_period), :user_id), operations_dashboard_users_with_projects_added: distinct_count(UsersOpsDashboardProject.joins(:user).merge(::User.active).where(time_period), :user_id),
projects_prometheus_active: distinct_count(::Project.with_active_prometheus_service.where(time_period), :creator_id), projects_prometheus_active: distinct_count(::Project.with_active_prometheus_service.where(time_period), :creator_id),
projects_with_error_tracking_enabled: distinct_count(::Project.with_enabled_error_tracking.where(time_period), :creator_id), projects_with_error_tracking_enabled: distinct_count(::Project.with_enabled_error_tracking.where(time_period), :creator_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