debian-mirror-gitlab/spec/support/helpers/metrics_dashboard_helpers.rb

37 lines
987 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
module MetricsDashboardHelpers
def project_with_dashboard(dashboard_path, dashboard_yml = nil)
dashboard_yml ||= fixture_file('lib/gitlab/metrics/dashboard/sample_dashboard.yml')
create(:project, :custom_repo, files: { dashboard_path => dashboard_yml })
end
def delete_project_dashboard(project, user, dashboard_path)
project.repository.delete_file(
user,
dashboard_path,
branch_name: 'master',
message: 'Delete dashboard'
)
project.repository.refresh_method_caches([:metrics_dashboard])
end
2019-10-12 21:52:04 +05:30
def system_dashboard_path
2020-01-01 13:55:28 +05:30
Metrics::Dashboard::SystemDashboardService::DASHBOARD_PATH
end
def pod_dashboard_path
Metrics::Dashboard::PodDashboardService::DASHBOARD_PATH
2019-10-12 21:52:04 +05:30
end
def business_metric_title
PrometheusMetricEnums.group_details[:business][:group_title]
end
2020-03-09 13:42:32 +05:30
def self_monitoring_dashboard_path
Metrics::Dashboard::SelfMonitoringDashboardService::DASHBOARD_PATH
2019-09-30 21:07:59 +05:30
end
2019-07-31 22:56:46 +05:30
end