diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-25 18:39:43 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-25 18:39:43 +0300 |
commit | 608186d54bb9aefb0b867c177ac62d534e8840ad (patch) | |
tree | c3ccf45692edd2b73dc9bdbfcf53500cce7532b0 /app/controllers | |
parent | 4d8f3978a254f33d959de65dbf7b20a1d41a058d (diff) |
Add per deployment additional metrics
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/deployments_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/projects/deployments_controller.rb b/app/controllers/projects/deployments_controller.rb index 6644deb49c9..29d94e2760a 100644 --- a/app/controllers/projects/deployments_controller.rb +++ b/app/controllers/projects/deployments_controller.rb @@ -22,6 +22,17 @@ class Projects::DeploymentsController < Projects::ApplicationController render_404 end + def additional_metrics + return render_404 unless deployment.has_additional_metrics? + metrics = deployment.additional_metrics + + if metrics&.any? + render json: metrics, status: :ok + else + head :no_content + end + end + private def deployment |