summaryrefslogtreecommitdiff
path: root/benchmark/memory_wrapper.rb
blob: 3f4451a037c4b54d26a075b1f91d85ef66c83491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

write_file, target, script_file = ARGV

load(script_file)
require_relative '../test/lib/memory_status'
open(write_file, 'wb'){|f|
  ms = Memory::Status.new
  case target.to_sym
  when :peak
    key = ms.respond_to?(:hwm) ? :hwm : :peak
  when :size
    key = ms.respond_to?(:rss) ? :rss : :size
  end

  f.puts ms[key]
}