2019-12-04 20:38:33 +05:30
|
|
|
.only-code-memory-job-base:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-06-23 00:09:42 +05:30
|
|
|
- .rails-cache
|
2019-12-04 20:38:33 +05:30
|
|
|
- .default-before_script
|
2020-03-13 15:44:24 +05:30
|
|
|
- .memory:rules
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
memory-static:
|
2019-12-04 20:38:33 +05:30
|
|
|
extends: .only-code-memory-job-base
|
2020-04-08 14:13:33 +05:30
|
|
|
stage: test
|
2020-05-24 23:13:21 +05:30
|
|
|
needs: ["setup-test-env"]
|
2019-12-04 20:38:33 +05:30
|
|
|
variables:
|
|
|
|
SETUP_DB: "false"
|
2019-09-30 21:07:59 +05:30
|
|
|
script:
|
|
|
|
# Uses two different reports from the 'derailed_benchmars' gem.
|
|
|
|
|
|
|
|
# Loads each of gems in the Gemfile and checks how much memory they consume when they are required.
|
|
|
|
# 'derailed_benchmarks' internally uses 'get_process_mem'
|
|
|
|
- bundle exec derailed bundle:mem > tmp/memory_bundle_mem.txt
|
|
|
|
- scripts/generate-gems-size-metrics-static tmp/memory_bundle_mem.txt >> 'tmp/memory_metrics.txt'
|
|
|
|
|
|
|
|
# Outputs detailed information about objects created while gems are loaded.
|
|
|
|
# 'derailed_benchmarks' internally uses 'memory_profiler'
|
|
|
|
- bundle exec derailed bundle:objects > tmp/memory_bundle_objects.txt
|
|
|
|
- scripts/generate-gems-memory-metrics-static tmp/memory_bundle_objects.txt >> 'tmp/memory_metrics.txt'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- tmp/memory_*.txt
|
|
|
|
reports:
|
|
|
|
metrics: tmp/memory_metrics.txt
|
2020-05-24 23:13:21 +05:30
|
|
|
expire_in: 31d
|
2019-09-30 21:07:59 +05:30
|
|
|
|
|
|
|
# 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:
|
2019-12-04 20:38:33 +05:30
|
|
|
extends:
|
|
|
|
- .only-code-memory-job-base
|
2021-06-08 01:23:25 +05:30
|
|
|
- .use-pg12
|
2020-04-08 14:13:33 +05:30
|
|
|
stage: test
|
2020-06-23 00:09:42 +05:30
|
|
|
needs: ["setup-test-env", "compile-test-assets"]
|
2019-09-30 21:07:59 +05:30
|
|
|
variables:
|
|
|
|
NODE_ENV: "production"
|
|
|
|
RAILS_ENV: "production"
|
|
|
|
SETUP_DB: "true"
|
|
|
|
script:
|
2020-04-08 14:13:33 +05:30
|
|
|
- PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> 'tmp/memory_on_boot.txt'
|
2019-09-30 21:07:59 +05:30
|
|
|
- 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
|
2020-05-24 23:13:21 +05:30
|
|
|
expire_in: 31d
|