diff --git a/Gemfile.lock b/Gemfile.lock index 6073f109fbeb821fa08204ccbfe864035b70b730..228d50b62f389becc33223560574ff1732008729 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ 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) diff --git a/lib/gitlab_exporter/database/ci_builds.rb b/lib/gitlab_exporter/database/ci_builds.rb index b3b5b09caa9962d04399b59cad08709f5ea184d2..b00e6b60f6f07aa8e05e4bbd80d2a296ca6037cb 100644 --- a/lib/gitlab_exporter/database/ci_builds.rb +++ b/lib/gitlab_exporter/database/ci_builds.rb @@ -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, diff --git a/lib/gitlab_exporter/version.rb b/lib/gitlab_exporter/version.rb index a01219b811a29c9b9adff4d7839d49dee5102f41..b1b4df581ac8a61458a78da114c1735f68eeb6c1 100644 --- a/lib/gitlab_exporter/version.rb +++ b/lib/gitlab_exporter/version.rb @@ -1,5 +1,5 @@ module GitLab module Exporter - VERSION = "5.0.0".freeze + VERSION = "5.0.1".freeze end end