diff options
author | rpereira2 <rpereira@gitlab.com> | 2018-12-21 14:11:58 +0300 |
---|---|---|
committer | rpereira2 <rpereira@gitlab.com> | 2018-12-21 14:11:58 +0300 |
commit | 2cd7b783910230bec4c6a704d820631e3ff048ed (patch) | |
tree | d98625e8c68e437ac973095cded9b7ea0be39861 /spec/lib/gitlab/prometheus | |
parent | ed4994c3ac1121b8f8ca93e2378b3b5d2ae0927d (diff) |
Correct ordering of metrics
Correct the ordering of metrics on performance dashboard. Before common
metrics were moved into the DB, metric groups were ordered by the
priority defined in the common_metrics.yml file.
This commit adds a priority to each metric group in the PrometheusMetric
model.
It also combines title, priority and required_metrics into one frozen
GROUP_DETAILS hash so that the code is clearer.
This can be done since there is a fixed set of groups which are not
configurable.
Diffstat (limited to 'spec/lib/gitlab/prometheus')
-rw-r--r-- | spec/lib/gitlab/prometheus/metric_group_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/prometheus/metric_group_spec.rb b/spec/lib/gitlab/prometheus/metric_group_spec.rb index e7d16e73663..5cc6827488b 100644 --- a/spec/lib/gitlab/prometheus/metric_group_spec.rb +++ b/spec/lib/gitlab/prometheus/metric_group_spec.rb @@ -21,6 +21,13 @@ describe Gitlab::Prometheus::MetricGroup do common_metric_group_a.id, common_metric_group_b_q1.id, common_metric_group_b_q2.id) end + + it 'orders by priority' do + priorities = subject.map(&:priority) + names = subject.map(&:name) + expect(priorities).to eq([10, 5]) + expect(names).to eq(['Response metrics (AWS ELB)', 'System metrics (Kubernetes)']) + end end describe '.for_project' do |