diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-12-07 10:27:07 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-12-07 10:27:07 +0100 |
commit | be12f3ed24b7c2d120e249d52179eb09bff7c8aa (patch) | |
tree | 67d3541306426a15d26b977dafcbc1b713d7283a /lib | |
parent | 5ccced63122fe2d21fff7d7298db1081776193b4 (diff) | |
download | gitlab-ce-be12f3ed24b7c2d120e249d52179eb09bff7c8aa.tar.gz |
Update pipeline create chain Prometheus metricmetrics/gb/add-tmp-stage-creation-metrics
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/create.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/create.rb b/lib/gitlab/ci/pipeline/chain/create.rb index 42ae1650437..d19a2519803 100644 --- a/lib/gitlab/ci/pipeline/chain/create.rb +++ b/lib/gitlab/ci/pipeline/chain/create.rb @@ -18,9 +18,7 @@ module Gitlab rescue ActiveRecord::RecordInvalid => e error("Failed to persist the pipeline: #{e}") ensure - pipeline.builds.find_each do |build| - next if build.stage_id.present? - + if pipeline.builds.where(stage_id: nil).any? invalid_builds_counter.increment(node: hostname) end end @@ -33,7 +31,8 @@ module Gitlab def invalid_builds_counter @counter ||= Gitlab::Metrics - .counter(:invalid_builds_counter, 'Invalid builds counter') + .counter(:gitlab_ci_invalid_builds_total, + 'Invalid builds without stage assigned counter') end def hostname |