Use max instead of avg to aggregate node CPUs
What does this MR do?
For Usage Ping, we currently collect all sorts of topology related data, including data about the physical nodes running GitLab on-premises. One such data point is the number of CPUs each node has.
We currently collect this data using Prometheus recording rules, then (because Usage Ping only runs once a week), fetch this data using some form of weekly aggregation. So far we've always pulled averages, since that makes sense for most of the data. For discrete values such as CPU cores, however, averages can be confusing since you might get fractional or odd values.
This MR adds support for aggregating via max_over_time
instead of just avg_over_time
, which should help get more sensible numbers for CPUs. We use max
because it is more likely that a node that is swapped out over the course of 7 days is upgraded rather than downgraded.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done