diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
commit | 0ab47b994caa80c5587f33dc818626b66cfdafe2 (patch) | |
tree | 5ef3976d2f84e3368903a67ba2dbd87a74b9a43c /lib/gitlab/metrics | |
parent | 1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/metrics')
-rw-r--r-- | lib/gitlab/metrics/dashboard/finder.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/metrics/dashboard/service_selector.rb | 1 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/gitlab/metrics/dashboard/finder.rb b/lib/gitlab/metrics/dashboard/finder.rb index 0374484d357..3dd86c8685d 100644 --- a/lib/gitlab/metrics/dashboard/finder.rb +++ b/lib/gitlab/metrics/dashboard/finder.rb @@ -65,7 +65,7 @@ module Gitlab def find_all_paths_from_source(project) Gitlab::Metrics::Dashboard::Cache.delete_all! - system_service.all_dashboard_paths(project) + default_dashboard_path(project) .+ project_service.all_dashboard_paths(project) end @@ -79,6 +79,18 @@ module Gitlab ::Metrics::Dashboard::ProjectDashboardService end + def self_monitoring_service + ::Metrics::Dashboard::SelfMonitoringDashboardService + end + + def default_dashboard_path(project) + if project.self_monitoring? + self_monitoring_service.all_dashboard_paths(project) + else + system_service.all_dashboard_paths(project) + end + end + def service_for(options) Gitlab::Metrics::Dashboard::ServiceSelector.call(options) end diff --git a/lib/gitlab/metrics/dashboard/service_selector.rb b/lib/gitlab/metrics/dashboard/service_selector.rb index 5a3007e4814..24ea85a5a95 100644 --- a/lib/gitlab/metrics/dashboard/service_selector.rb +++ b/lib/gitlab/metrics/dashboard/service_selector.rb @@ -18,6 +18,7 @@ module Gitlab ::Metrics::Dashboard::DefaultEmbedService, ::Metrics::Dashboard::SystemDashboardService, ::Metrics::Dashboard::PodDashboardService, + ::Metrics::Dashboard::SelfMonitoringDashboardService, ::Metrics::Dashboard::ProjectDashboardService ].freeze |