Commit a5a15849 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'mk/max-over-cpus' into 'master'

Use max instead of avg to aggregate node CPUs

See merge request gitlab-org/gitlab!37174
parents b10f6309 e6177448
...@@ -91,7 +91,7 @@ module Gitlab ...@@ -91,7 +91,7 @@ module Gitlab
def topology_node_cpus(client) def topology_node_cpus(client)
query_safely('gitlab_usage_ping:node_cpus:count', 'node_cpus', fallback: {}) do |query| query_safely('gitlab_usage_ping:node_cpus:count', 'node_cpus', fallback: {}) do |query|
aggregate_by_instance(client, one_week_average(query)) aggregate_by_instance(client, one_week_average(query, aggregation: :max))
end end
end end
...@@ -228,8 +228,8 @@ module Gitlab ...@@ -228,8 +228,8 @@ module Gitlab
end end
end end
def one_week_average(query) def one_week_average(query, aggregation: :avg)
"avg_over_time (#{query}[1w])" "#{aggregation}_over_time (#{query}[1w])"
end end
def aggregate_by_instance(client, query) def aggregate_by_instance(client, query)
......
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