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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-12-07 12:27:07 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-12-07 12:27:07 +0300
commitbe12f3ed24b7c2d120e249d52179eb09bff7c8aa (patch)
tree67d3541306426a15d26b977dafcbc1b713d7283a /lib/gitlab/ci
parent5ccced63122fe2d21fff7d7298db1081776193b4 (diff)
Update pipeline create chain Prometheus metric
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r--lib/gitlab/ci/pipeline/chain/create.rb7
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