debian-mirror-gitlab/.gitlab/ci/memory.gitlab-ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
YAML
Raw Normal View History

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
2021-11-18 22:05:49 +05:30
variables:
METRICS_FILE: "metrics.txt"
artifacts:
reports:
metrics: "${METRICS_FILE}"
2022-05-07 20:08:51 +05:30
expire_in: 62d
2019-12-04 20:38:33 +05:30
2019-09-30 21:07:59 +05:30
# Show memory usage caused by invoking require per gem.
2022-04-04 11:22:00 +05:30
# Hits the app with one request to ensure that any last minute require-s have been called.
2019-09-30 21:07:59 +05:30
# 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
2023-04-23 21:23:45 +05:30
- .production
2023-06-20 00:43:36 +05:30
- .use-pg13
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:
SETUP_DB: "true"
2022-05-07 20:08:51 +05:30
MEMORY_ON_BOOT_FILE_PREFIX: "tmp/memory_on_boot_"
TEST_COUNT: 5
2019-09-30 21:07:59 +05:30
script:
2022-05-07 20:08:51 +05:30
- |
for i in $(seq 1 $TEST_COUNT)
do
echo "Starting run $i out of $TEST_COUNT"
PATH_TO_HIT="/users/sign_in" CUT_OFF=0.3 bundle exec derailed exec perf:mem >> "${MEMORY_ON_BOOT_FILE_PREFIX}$i.txt"
done
- scripts/generate-memory-metrics-on-boot "${MEMORY_ON_BOOT_FILE_PREFIX}" "$TEST_COUNT" >> "${METRICS_FILE}"
2019-09-30 21:07:59 +05:30
artifacts:
paths:
2021-11-18 22:05:49 +05:30
- "${METRICS_FILE}"
2022-05-07 20:08:51 +05:30
- "${MEMORY_ON_BOOT_FILE_PREFIX}*.txt"