debian-mirror-gitlab/app/helpers/custom_metrics_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
651 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
module CustomMetricsHelper
def custom_metrics_data(project, metric)
{
2020-10-24 23:57:45 +05:30
'custom-metrics-path' => url_for([project, metric]),
2020-04-22 19:07:51 +05:30
'metric-persisted' => metric.persisted?.to_s,
2022-07-23 23:45:48 +05:30
'edit-integration-path' => edit_project_settings_integration_path(project, ::Integrations::Prometheus),
2020-04-22 19:07:51 +05:30
'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