summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsyasonik <syasonik@gitlab.com>2019-04-17 19:45:06 +0800
committersyasonik <syasonik@gitlab.com>2019-04-24 18:23:03 +0800
commit9a9cb2534ca931bf02bae9f86201129bdb6fa3c3 (patch)
tree717ca0aaa9818f99164d5f3c06d8227a92859559 /lib
parent671f698845339563852abcb0b9607632fd8076a6 (diff)
downloadgitlab-ce-9a9cb2534ca931bf02bae9f86201129bdb6fa3c3.tar.gz
Minor line length cleanup
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/metrics_dashboard/processor.rb3
-rw-r--r--lib/gitlab/metrics_dashboard/stages/project_metrics_inserter.rb17
2 files changed, 11 insertions, 9 deletions
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<Hash>]
# @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<Hash>]
# @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<Hash>]
# @param metric [PrometheusMetric]
def find_or_create_metric(metrics, metric)