mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
17 lines
314 B
Ruby
17 lines
314 B
Ruby
|
|
||
|
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.member?(:hwm) ? :hwm : :peak
|
||
|
when :size
|
||
|
key = ms.member?(:rss) ? :rss : :size
|
||
|
end
|
||
|
|
||
|
f.puts ms[key]
|
||
|
}
|