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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
16bff374
Commit
16bff374
authored
Dec 20, 2021
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse runner_type and project_id stored in running builds table
parent
b48d81a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
lib/gitlab/ci/queue/metrics.rb
lib/gitlab/ci/queue/metrics.rb
+2
-3
No files found.
lib/gitlab/ci/queue/metrics.rb
View file @
16bff374
...
@@ -240,7 +240,6 @@ module Gitlab
...
@@ -240,7 +240,6 @@ module Gitlab
# excluding currently started job
# excluding currently started job
running_jobs_count
=
running_jobs_relation
(
job
)
running_jobs_count
=
running_jobs_relation
(
job
)
.
where
(
runner:
::
Ci
::
Runner
.
instance_type
)
.
limit
(
JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET
+
1
).
count
-
1
.
limit
(
JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET
+
1
).
count
-
1
if
running_jobs_count
<
JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET
if
running_jobs_count
<
JOBS_RUNNING_FOR_PROJECT_MAX_BUCKET
...
@@ -252,9 +251,9 @@ module Gitlab
...
@@ -252,9 +251,9 @@ module Gitlab
def
running_jobs_relation
(
job
)
def
running_jobs_relation
(
job
)
if
::
Feature
.
enabled?
(
:ci_pending_builds_maintain_denormalized_data
,
default_enabled: :yaml
)
if
::
Feature
.
enabled?
(
:ci_pending_builds_maintain_denormalized_data
,
default_enabled: :yaml
)
::
Ci
::
RunningBuild
.
where
(
project_id:
job
.
project
.
id
)
::
Ci
::
RunningBuild
.
instance_type
.
where
(
project_id:
job
.
project_
id
)
else
else
job
.
project
.
builds
.
running
job
.
project
.
builds
.
running
.
where
(
runner:
::
Ci
::
Runner
.
instance_type
)
end
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: enable CodeReuse/ActiveRecord
...
...
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