Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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 13:49:57 +0300
commitfb1d433703f902987a358af0d9cac12b64ec440e (patch)
tree8caf42f0323a3137747b87a6a93637dd736b0b15 /scripts/generate-memory-metrics-on-boot
parent5ee5b280b05f63768f359d0b82d5edd490c0e7cd (diff)
Get memory data after booting app in production
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-xscripts/generate-memory-metrics-on-boot11
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)}"