summaryrefslogtreecommitdiff
path: root/.gitlab/ci/memory.gitlab-ci.yml
diff options
context:
space:
mode:
authorAleksei Lipniagov <alipniagov@gitlab.com>2019-06-25 15:11:06 +0300
committerAleksei Lipniagov <alipniagov@gitlab.com>2019-06-28 20:12:50 +0300
commitf44719f39cb9ee88c63759caa582d484cd6d4e9a (patch)
tree7afc8b86283c3e1537f728c66ef3b0130e2b677d /.gitlab/ci/memory.gitlab-ci.yml
parent1cd8fb49f9b9150faf50767edbdfb564fde8576b (diff)
downloadgitlab-ce-f44719f39cb9ee88c63759caa582d484cd6d4e9a.tar.gz
Get memory data after booting app in production62722-boot-app-in-ci-and-check-memory-ce
Preload the app in `production` env, hit it with a single request, and gather total gem memory consumption data using `derailed exec perf:mem` from `derailed_benchmarks`. Present the result as MR metrics.
Diffstat (limited to '.gitlab/ci/memory.gitlab-ci.yml')
-rw-r--r--.gitlab/ci/memory.gitlab-ci.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/.gitlab/ci/memory.gitlab-ci.yml b/.gitlab/ci/memory.gitlab-ci.yml
index 2f3907a331a..ffe5dbdc31b 100644
--- a/.gitlab/ci/memory.gitlab-ci.yml
+++ b/.gitlab/ci/memory.gitlab-ci.yml
@@ -17,3 +17,26 @@ memory-static:
- tmp/memory_*.txt
reports:
metrics: tmp/memory_metrics.txt
+
+# Show memory usage caused by invoking require per gem.
+# Unlike `memory-static`, it hits the app with one request to ensure that any last minute require-s have been called.
+# The application is booted in `production` environment.
+# All tests are run without a webserver (directly using Rack::Mock by default).
+memory-on-boot:
+ extends: .rspec-metadata-pg-10
+ variables:
+ NODE_ENV: "production"
+ RAILS_ENV: "production"
+ SETUP_DB: "true"
+ SKIP_STORAGE_VALIDATION: "true"
+ # we override the max_old_space_size to prevent OOM errors
+ NODE_OPTIONS: --max_old_space_size=3584
+ script:
+ # Both bootsnap and derailed monkey-patch Kernel#require, which leads to circular dependency
+ - DISABLE_BOOTSNAP=true PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> 'tmp/memory_on_boot.txt'
+ - scripts/generate-memory-metrics-on-boot tmp/memory_on_boot.txt >> 'tmp/memory_on_boot_metrics.txt'
+ artifacts:
+ paths:
+ - tmp/memory_*.txt
+ reports:
+ metrics: tmp/memory_on_boot_metrics.txt