summaryrefslogtreecommitdiff
path: root/scripts/generate-memory-metrics-on-boot
blob: 945661aa057d805b5e62442eb501b159e27bc213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env ruby
# frozen_string_literal: true

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)}"