Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 17:02:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-18 17:02:45 +0300
commit80f61b4035607d7cd87de993b8f5e996bde3481f (patch)
tree06b12f51e97d87192e3dd0e05edf55143645b894 /lib/gitlab/metrics/dashboard/processor.rb
parent4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/metrics/dashboard/processor.rb')
-rw-r--r--lib/gitlab/metrics/dashboard/processor.rb32
1 files changed, 6 insertions, 26 deletions
diff --git a/lib/gitlab/metrics/dashboard/processor.rb b/lib/gitlab/metrics/dashboard/processor.rb
index c0fa3bb2f3a..bfdee76a818 100644
--- a/lib/gitlab/metrics/dashboard/processor.rb
+++ b/lib/gitlab/metrics/dashboard/processor.rb
@@ -8,43 +8,23 @@ module Gitlab
# the UI. These includes shared metric info, custom metrics
# info, and alerts (only in EE).
class Processor
- SYSTEM_SEQUENCE = [
- Stages::CommonMetricsInserter,
- Stages::ProjectMetricsInserter,
- Stages::EndpointInserter,
- Stages::Sorter
- ].freeze
-
- PROJECT_SEQUENCE = [
- Stages::CommonMetricsInserter,
- Stages::EndpointInserter,
- Stages::Sorter
- ].freeze
-
- def initialize(project, environment, dashboard)
+ def initialize(project, dashboard, sequence, params)
@project = project
- @environment = environment
@dashboard = dashboard
+ @sequence = sequence
+ @params = params
end
# Returns a new dashboard hash with the results of
# running transforms on the dashboard.
- def process(insert_project_metrics:)
+ def process
@dashboard.deep_symbolize_keys.tap do |dashboard|
- sequence(insert_project_metrics).each do |stage|
- stage.new(@project, @environment, dashboard).transform!
+ @sequence.each do |stage|
+ stage.new(@project, dashboard, @params).transform!
end
end
end
-
- private
-
- def sequence(insert_project_metrics)
- insert_project_metrics ? SYSTEM_SEQUENCE : PROJECT_SEQUENCE
- end
end
end
end
end
-
-Gitlab::Metrics::Dashboard::Processor.prepend_if_ee('EE::Gitlab::Metrics::Dashboard::Processor')