diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /lib/gitlab/usage_data | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'lib/gitlab/usage_data')
-rw-r--r-- | lib/gitlab/usage_data/topology.rb | 13 |
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) |