From 9a9cb2534ca931bf02bae9f86201129bdb6fa3c3 Mon Sep 17 00:00:00 2001 From: syasonik Date: Wed, 17 Apr 2019 19:45:06 +0800 Subject: Minor line length cleanup --- lib/gitlab/metrics_dashboard/processor.rb | 3 ++- .../stages/project_metrics_inserter.rb | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/metrics_dashboard/processor.rb b/lib/gitlab/metrics_dashboard/processor.rb index 14ee12049d0..3b8ab27a07b 100644 --- a/lib/gitlab/metrics_dashboard/processor.rb +++ b/lib/gitlab/metrics_dashboard/processor.rb @@ -18,7 +18,8 @@ module Gitlab end 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 end diff --git a/lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb b/lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb index 7b694c6e5fa..af59e6f5910 100644 --- a/lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb +++ b/lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb @@ -4,8 +4,9 @@ module Gitlab module MetricsDashboard module Stages class ProjectMetricsInserter < BaseStage - # Inserts project-specific metrics into the dashboard config. - # If there are no project-specific metrics, this will have no effect. + # Inserts project-specific metrics into the dashboard + # config. If there are no project-specific metrics, + # this will have no effect. def transform! project.prometheus_metrics.each do |project_metric| group = find_or_create_panel_group(dashboard[:panel_groups], project_metric) @@ -16,8 +17,8 @@ module Gitlab private - # Looks for a panel_group corresponding to the provided metric object. - # If unavailable, inserts one. + # Looks for a panel_group corresponding to the + # provided metric object. If unavailable, inserts one. # @param panel_groups [Array] # @param metric [PrometheusMetric] def find_or_create_panel_group(panel_groups, metric) @@ -30,8 +31,8 @@ module Gitlab panel_group end - # Looks for a panel corresponding to the provided metric object. - # If unavailable, inserts one. + # Looks for a panel corresponding to the provided + # metric object. If unavailable, inserts one. # @param panels [Array] # @param metric [PrometheusMetric] def find_or_create_panel(panels, metric) @@ -44,8 +45,8 @@ module Gitlab panel end - # Looks for a metric corresponding to the provided metric object. - # If unavailable, inserts one. + # Looks for a metric corresponding to the provided + # metric object. If unavailable, inserts one. # @param metrics [Array] # @param metric [PrometheusMetric] def find_or_create_metric(metrics, metric) -- cgit v1.2.1