diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-08 10:00:20 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-08 10:00:20 +0000 |
commit | 05e88a0d12b5ae79fcd5a7e26a5eb1bb259843ec (patch) | |
tree | e355e60f63f9cc4c0a5e54a7f5b4de3a7463303f /app/services | |
parent | acdd1bf7c92b7e9cdbd579df8faca5ea7783489f (diff) | |
parent | ff1bc1778d7fe40ac96d8515dc04195d56aced07 (diff) | |
download | gitlab-ce-05e88a0d12b5ae79fcd5a7e26a5eb1bb259843ec.tar.gz |
Merge branch 'zj-prom-pipeline-count' into 'master'
Add prometheus metrics on pipeline creation
Closes #32624
See merge request !11975
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index bffec216819..769749c9925 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -57,6 +57,8 @@ module Ci cancel_pending_pipelines if project.auto_cancel_pending_pipelines? + pipeline_created_counter.increment(source: source) + pipeline.tap(&:process!) end @@ -131,5 +133,9 @@ module Ci pipeline.drop if save pipeline end + + def pipeline_created_counter + @pipeline_created_counter ||= Gitlab::Metrics.counter(:pipelines_created_count, "Pipelines created count") + end end end |