Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
382a1ef4
Commit
382a1ef4
authored
Dec 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invalid builds counter metric to stage seeds class
parent
0131c97c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
lib/gitlab/ci/stage/seed.rb
lib/gitlab/ci/stage/seed.rb
+13
-0
No files found.
lib/gitlab/ci/stage/seed.rb
View file @
382a1ef4
...
@@ -39,6 +39,10 @@ module Gitlab
...
@@ -39,6 +39,10 @@ module Gitlab
pipeline
.
stages
.
create!
(
stage
).
tap
do
|
stage
|
pipeline
.
stages
.
create!
(
stage
).
tap
do
|
stage
|
builds_attributes
=
builds
.
map
do
|
attributes
|
builds_attributes
=
builds
.
map
do
|
attributes
|
attributes
.
merge
(
stage_id:
stage
.
id
)
attributes
.
merge
(
stage_id:
stage
.
id
)
if
attributes
.
fetch
(
:stage_id
).
nil?
invalid_builds_counter
.
increment
(
node:
hostname
)
end
end
end
pipeline
.
builds
.
create!
(
builds_attributes
).
each
do
|
build
|
pipeline
.
builds
.
create!
(
builds_attributes
).
each
do
|
build
|
...
@@ -52,6 +56,15 @@ module Gitlab
...
@@ -52,6 +56,15 @@ module Gitlab
def
protected_ref?
def
protected_ref?
@protected_ref
||=
project
.
protected_for?
(
pipeline
.
ref
)
@protected_ref
||=
project
.
protected_for?
(
pipeline
.
ref
)
end
end
def
invalid_builds_counter
@counter
||=
Gitlab
::
Metrics
.
counter
(
:invalid_builds_counter
,
'Builds without stage assigned counter'
)
end
def
hostname
@hostname
||=
Socket
.
gethostname
end
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment