| Server IP : 188.151.22.197 / Your IP : 216.73.217.74 Web Server : Apache/2.4.62 (Rocky Linux) OpenSSL/3.5.5 System : Linux wsten.se 5.14.0-687.30.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 13:09:21 UTC 2026 x86_64 User : apache ( 48) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/gitlab/embedded/service/gitlab-rails/scripts/ |
Upload File : |
#!/usr/bin/env ruby
# frozen_string_literal: true
abort "usage: #{__FILE__} <memory_bundle_mem_file_name_prefix> <test_count>" unless ARGV.length == 2
memory_bundle_mem_file_name_prefix = ARGV.first
test_count = ARGV.last.to_i
results = []
(1..test_count).each do |i|
report_filename = "#{memory_bundle_mem_file_name_prefix}#{i}.txt"
stats = nil
File.foreach(report_filename).detect do |line|
stats = /TOP: (?<total_mibs_str>.*) MiB/.match(line)
end
abort 'failed to process the benchmark output' unless stats
total_mibs = stats[:total_mibs_str].to_f
results << total_mibs
end
res = results.sort
median = (res[(test_count - 1) / 2] + res[test_count / 2]) / 2.0
METRIC_NAME = "total_memory_used_by_dependencies_on_boot_prod_env_mb"
puts "# TYPE #{METRIC_NAME} gauge"
puts "# UNIT #{METRIC_NAME} mebibytes"
puts "#{METRIC_NAME} #{median.round(1)}"