Commit 2d4a7c3f authored by Ahmad Sherif's avatar Ahmad Sherif

Merge branch 'ab-ci-builds-performance' into 'master'

Limit CI builds queries to 7 days

See merge request gitlab-org/gitlab-exporter!101
parents 4f93afa4 81ca3ef1
Pipeline #133686 passed with stage
in 1 minute and 7 seconds
PATH
remote: .
specs:
gitlab-exporter (4.2.0)
gitlab-exporter (5.0.1)
connection_pool (~> 2.2.1)
pg (~> 1.1)
quantile (~> 0.2.0)
......@@ -23,7 +23,7 @@ GEM
powerpack (0.1.1)
quantile (0.2.1)
rack (2.0.7)
rack-protection (2.0.5)
rack-protection (2.0.7)
rack
rainbow (2.1.0)
redis (4.1.2)
......@@ -54,10 +54,10 @@ GEM
rack (>= 1.5.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
sinatra (2.0.5)
sinatra (2.0.7)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
rack-protection (= 2.0.7)
tilt (~> 2.0)
tilt (2.0.9)
unicode-display_width (1.1.0)
......
......@@ -25,6 +25,8 @@ module GitLab
ON application_settings.id = 1
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status = '%s'
-- The created_at filter has been introduced for performance reasons only
AND ci_builds.created_at > NOW() - INTERVAL '7 days'
AND projects.pending_delete = 'f'
GROUP BY
projects.namespace_id,
......@@ -47,6 +49,8 @@ module GitLab
ON projects.id = ci_builds.project_id
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status = '%s'
-- The created_at filter has been introduced for performance reasons only
AND ci_builds.created_at > NOW() - INTERVAL '7 days'
AND projects.pending_delete = 'f'
GROUP BY
projects.namespace_id,
......@@ -95,6 +99,8 @@ module GitLab
ON application_settings.id = 1
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status = 'running'
-- The created_at filter has been introduced for performance reasons only
AND ci_builds.created_at > NOW() - INTERVAL '7 days'
AND projects.pending_delete = 'f'
GROUP BY
ci_builds.runner_id,
......@@ -127,6 +133,8 @@ module GitLab
ON ci_pipelines.id = ci_builds.commit_id
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status = 'running'
-- The created_at filter has been introduced for performance reasons only
AND ci_builds.created_at > NOW() - INTERVAL '7 days'
AND projects.pending_delete = 'f'
GROUP BY
ci_builds.runner_id,
......@@ -171,6 +179,8 @@ module GitLab
ON application_settings.id = 1
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status IN ('running', 'pending')
-- The created_at filter has been introduced for performance reasons only
AND ci_builds.created_at > NOW() - INTERVAL '7 days'
GROUP BY
projects.namespace_id,
projects.shared_runners_enabled,
......@@ -215,6 +225,8 @@ module GitLab
ON namespaces.id = projects.namespace_id
WHERE ci_builds.type = 'Ci::Build'
AND ci_builds.status IN ('running', 'pending')
-- The created_at filter has been introduced for performance reasons only
AND ci_builds.created_at > NOW() - INTERVAL '7 days'
GROUP BY
projects.namespace_id,
projects.shared_runners_enabled,
......
module GitLab
module Exporter
VERSION = "5.0.0".freeze
VERSION = "5.0.1".freeze
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment