Class: Gitlab::Prometheus::MetricGroup
- Inherits:
-
Object
- Object
- Gitlab::Prometheus::MetricGroup
- Includes:
- ActiveModel::Model
- Defined in:
- lib/gitlab/prometheus/metric_group.rb
Instance Attribute Summary collapse
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#name ⇒ Object
Returns the value of attribute name.
-
#priority ⇒ Object
Returns the value of attribute priority.
Class Method Summary collapse
Instance Attribute Details
#metrics ⇒ Object
Returns the value of attribute metrics.
8 9 10 |
# File 'lib/gitlab/prometheus/metric_group.rb', line 8 def metrics @metrics end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/gitlab/prometheus/metric_group.rb', line 8 def name @name end |
#priority ⇒ Object
Returns the value of attribute priority.
8 9 10 |
# File 'lib/gitlab/prometheus/metric_group.rb', line 8 def priority @priority end |
Class Method Details
.common_metrics ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/gitlab/prometheus/metric_group.rb', line 12 def self.common_metrics all_groups = ::PrometheusMetricsFinder.new(common: true).execute .group_by(&:group_title) .map do |name, metrics| MetricGroup.new( name: name, priority: metrics.map(&:priority).max, metrics: metrics.map(&:to_query_metric) ) end all_groups.sort_by(&:priority).reverse end |
.for_project(_) ⇒ Object
EE only
27 28 29 |
# File 'lib/gitlab/prometheus/metric_group.rb', line 27 def self.for_project(_) common_metrics end |