Commit 9a9cb253 authored by syasonik's avatar syasonik

Minor line length cleanup

parent 671f6988
...@@ -18,7 +18,8 @@ module Gitlab ...@@ -18,7 +18,8 @@ module Gitlab
end end
def process def process
stages.each { |stage| stage.new(@dashboard, @project, @environment).transform! } stage_params = [@dashboard, @project, @environment]
stages.each { |stage| stage.new(*stage_params).transform! }
@dashboard @dashboard
end end
......
...@@ -4,8 +4,9 @@ module Gitlab ...@@ -4,8 +4,9 @@ module Gitlab
module MetricsDashboard module MetricsDashboard
module Stages module Stages
class ProjectMetricsInserter < BaseStage class ProjectMetricsInserter < BaseStage
# Inserts project-specific metrics into the dashboard config. # Inserts project-specific metrics into the dashboard
# If there are no project-specific metrics, this will have no effect. # config. If there are no project-specific metrics,
# this will have no effect.
def transform! def transform!
project.prometheus_metrics.each do |project_metric| project.prometheus_metrics.each do |project_metric|
group = find_or_create_panel_group(dashboard[:panel_groups], project_metric) group = find_or_create_panel_group(dashboard[:panel_groups], project_metric)
...@@ -16,8 +17,8 @@ module Gitlab ...@@ -16,8 +17,8 @@ module Gitlab
private private
# Looks for a panel_group corresponding to the provided metric object. # Looks for a panel_group corresponding to the
# If unavailable, inserts one. # provided metric object. If unavailable, inserts one.
# @param panel_groups [Array<Hash>] # @param panel_groups [Array<Hash>]
# @param metric [PrometheusMetric] # @param metric [PrometheusMetric]
def find_or_create_panel_group(panel_groups, metric) def find_or_create_panel_group(panel_groups, metric)
...@@ -30,8 +31,8 @@ module Gitlab ...@@ -30,8 +31,8 @@ module Gitlab
panel_group panel_group
end end
# Looks for a panel corresponding to the provided metric object. # Looks for a panel corresponding to the provided
# If unavailable, inserts one. # metric object. If unavailable, inserts one.
# @param panels [Array<Hash>] # @param panels [Array<Hash>]
# @param metric [PrometheusMetric] # @param metric [PrometheusMetric]
def find_or_create_panel(panels, metric) def find_or_create_panel(panels, metric)
...@@ -44,8 +45,8 @@ module Gitlab ...@@ -44,8 +45,8 @@ module Gitlab
panel panel
end end
# Looks for a metric corresponding to the provided metric object. # Looks for a metric corresponding to the provided
# If unavailable, inserts one. # metric object. If unavailable, inserts one.
# @param metrics [Array<Hash>] # @param metrics [Array<Hash>]
# @param metric [PrometheusMetric] # @param metric [PrometheusMetric]
def find_or_create_metric(metrics, metric) def find_or_create_metric(metrics, metric)
......
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