summaryrefslogtreecommitdiff
path: root/lib/gitlab/usage_data/topology.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/usage_data/topology.rb')
-rw-r--r--lib/gitlab/usage_data/topology.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/gitlab/usage_data/topology.rb b/lib/gitlab/usage_data/topology.rb
index edc4dc75750..7f7854c3eb1 100644
--- a/lib/gitlab/usage_data/topology.rb
+++ b/lib/gitlab/usage_data/topology.rb
@@ -40,9 +40,10 @@ module Gitlab
private
def topology_fetch_all_data
- with_prometheus_client(fallback: {}) do |client|
+ with_prometheus_client(fallback: {}, verify: false) do |client|
{
application_requests_per_hour: topology_app_requests_per_hour(client),
+ query_apdex_weekly_average: topology_query_apdex_weekly_average(client),
nodes: topology_node_data(client)
}.compact
end
@@ -63,6 +64,16 @@ module Gitlab
(result['value'].last.to_f * 1.hour).to_i
end
+ def topology_query_apdex_weekly_average(client)
+ result = query_safely('gitlab_usage_ping:sql_duration_apdex:ratio_rate5m', 'query_apdex', fallback: nil) do |query|
+ client.query(aggregate_one_week(query)).first
+ end
+
+ return unless result
+
+ result['value'].last.to_f
+ end
+
def topology_node_data(client)
# node-level data
by_instance_mem = topology_node_memory(client)