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:
authorPeter Leitzen <pleitzen@gitlab.com>2019-04-29 13:25:31 +0300
committerDouwe Maan <douwe@gitlab.com>2019-04-29 13:25:31 +0300
commit80fec5c3295977c5559c420f51fd774391d3ca91 (patch)
tree3f8dab112c87e54ae591425a2f739aa6f7410660 /app/controllers
parentab9910f7a5fe4981b330c3886865397fd066108d (diff)
Load environment metrics only for JSON endpoint
When showing the HTML version of the environment metrics we don't need to fetch their metrics because we don't use them anymore on the HTML version. We use additional_metrics.json endpoint now.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/environments_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index 1f619c8fd2f..4aa572ade73 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -135,13 +135,13 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def metrics
- # Currently, this acts as a hint to load the metrics details into the cache
- # if they aren't there already
- @metrics = environment.metrics || {}
-
respond_to do |format|
format.html
format.json do
+ # Currently, this acts as a hint to load the metrics details into the cache
+ # if they aren't there already
+ @metrics = environment.metrics || {}
+
render json: @metrics, status: @metrics.any? ? :ok : :no_content
end
end