diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-07 16:57:42 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-07 16:57:42 +0000 |
commit | 55f2a5debcf10a4d3ca1d0e53fe06f38bc0b77a9 (patch) | |
tree | 6ebbdf0f12c5e0d30a3e806284c361b8764d9ccf /app/models/environment.rb | |
parent | a5db7f54252d22e3ecd49786a3fdff7c46658fa3 (diff) | |
download | gitlab-ce-55f2a5debcf10a4d3ca1d0e53fe06f38bc0b77a9.tar.gz |
Added Prometheus Service and Prometheus graphs
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 1a21b5e52b5..bf33010fd21 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -145,6 +145,14 @@ class Environment < ActiveRecord::Base project.deployment_service.terminals(self) if has_terminals? end + def has_metrics? + project.monitoring_service.present? && available? && last_deployment.present? + end + + def metrics + project.monitoring_service.metrics(self) if has_metrics? + end + # An environment name is not necessarily suitable for use in URLs, DNS # or other third-party contexts, so provide a slugified version. A slug has # the following properties: |