diff options
author | Aleksei Lipniagov <alipniagov@gitlab.com> | 2019-06-25 15:11:06 +0300 |
---|---|---|
committer | Aleksei Lipniagov <alipniagov@gitlab.com> | 2019-06-28 20:12:50 +0300 |
commit | f44719f39cb9ee88c63759caa582d484cd6d4e9a (patch) | |
tree | 7afc8b86283c3e1537f728c66ef3b0130e2b677d /scripts/generate-memory-metrics-on-boot | |
parent | 1cd8fb49f9b9150faf50767edbdfb564fde8576b (diff) | |
download | gitlab-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 'scripts/generate-memory-metrics-on-boot')
-rwxr-xr-x | scripts/generate-memory-metrics-on-boot | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/generate-memory-metrics-on-boot b/scripts/generate-memory-metrics-on-boot new file mode 100755 index 00000000000..5197a8fcdcd --- /dev/null +++ b/scripts/generate-memory-metrics-on-boot @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +abort "usage: #{__FILE__} <memory_bundle_mem_file_name>" unless ARGV.length == 1 +memory_bundle_mem_file_name = ARGV.first + +full_report = File.open(memory_bundle_mem_file_name).read + +stats = /TOP: (?<total_mibs_str>.*) MiB/.match(full_report) +abort 'failed to process the benchmark output' unless stats + +puts "total_memory_used_by_dependencies_on_boot_prod_env_mb #{stats[:total_mibs_str].to_f.round(1)}" |