mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
a036c02650
* benchmark/memory_wrapper.rb: use respond_to? because member? does not work well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
16 lines
322 B
Ruby
16 lines
322 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.respond_to?(:hwm) ? :hwm : :peak
|
|
when :size
|
|
key = ms.respond_to?(:rss) ? :rss : :size
|
|
end
|
|
|
|
f.puts ms[key]
|
|
}
|