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:
authorRémy Coutable <remy@rymai.me>2017-03-07 19:57:44 +0300
committerRémy Coutable <remy@rymai.me>2017-03-07 19:57:44 +0300
commit4998f15169f0d8875676070ee29b5cbca96d582d (patch)
tree6ebbdf0f12c5e0d30a3e806284c361b8764d9ccf /app/controllers
parenta5db7f54252d22e3ecd49786a3fdff7c46658fa3 (diff)
parent55f2a5debcf10a4d3ca1d0e53fe06f38bc0b77a9 (diff)
Merge branch 'prometheus-monitoring' into 'master'
Added Prometheus Service and Prometheus graphs See merge request !8935
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/environments_controller.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index fed75396d6e..fa37963dfd4 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -5,7 +5,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action :authorize_create_deployment!, only: [:stop]
before_action :authorize_update_environment!, only: [:edit, :update]
before_action :authorize_admin_environment!, only: [:terminal, :terminal_websocket_authorize]
- before_action :environment, only: [:show, :edit, :update, :stop, :terminal, :terminal_websocket_authorize]
+ before_action :environment, only: [:show, :edit, :update, :stop, :terminal, :terminal_websocket_authorize, :metrics]
before_action :verify_api_request!, only: :terminal_websocket_authorize
def index
@@ -109,6 +109,19 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
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
+ render json: @metrics, status: @metrics.any? ? :ok : :no_content
+ end
+ end
+ end
+
private
def verify_api_request!