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

custom_metrics_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5442120008a6b8fbe2af641ae0e2487b3203f6ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module CustomMetricsHelper
  def custom_metrics_data(project, metric)
    {
      'custom-metrics-path' => url_for([project, metric]),
      'metric-persisted' => metric.persisted?.to_s,
      'edit-project-service-path' => edit_project_integration_path(project, ::Integrations::Prometheus),
      'validate-query-path' => validate_query_project_prometheus_metrics_path(project),
      'title' => metric.title.to_s,
      'query' => metric.query.to_s,
      'y-label' => metric.y_label.to_s,
      'unit' => metric.unit.to_s,
      'group' => metric.group.to_s,
      'legend' => metric.legend.to_s
    }
  end
end