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:
Diffstat (limited to 'lib/gitlab/metrics/dashboard/stages/alerts_inserter.rb')
-rw-r--r--lib/gitlab/metrics/dashboard/stages/alerts_inserter.rb41
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/gitlab/metrics/dashboard/stages/alerts_inserter.rb b/lib/gitlab/metrics/dashboard/stages/alerts_inserter.rb
deleted file mode 100644
index 38736158c3b..00000000000
--- a/lib/gitlab/metrics/dashboard/stages/alerts_inserter.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-require 'set'
-
-module Gitlab
- module Metrics
- module Dashboard
- module Stages
- class AlertsInserter < BaseStage
- include ::Gitlab::Utils::StrongMemoize
-
- def transform!
- return if metrics_with_alerts.empty?
-
- for_metrics do |metric|
- next unless metrics_with_alerts.include?(metric[:metric_id])
-
- metric[:alert_path] = alert_path(metric[:metric_id], project, params[:environment])
- end
- end
-
- private
-
- def metrics_with_alerts
- strong_memoize(:metrics_with_alerts) do
- alerts = ::Projects::Prometheus::AlertsFinder
- .new(project: project, environment: params[:environment])
- .execute
-
- Set.new(alerts.map(&:prometheus_metric_id))
- end
- end
-
- def alert_path(metric_id, project, environment)
- ::Gitlab::Routing.url_helpers.project_prometheus_alert_path(project, metric_id, environment_id: environment.id, format: :json)
- end
- end
- end
- end
- end
-end