Created
September 22, 2009 09:45
-
-
Save flyerhzm/190949 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
pid = `ps | grep script/serve[r] | awk '{ print $1 }'`.chomp | |
puts "Server PID: #{pid}" | |
url = ARGV.last | |
puts "URL: #{url}" | |
puts "Hit enter to go." | |
$stdin.gets | |
def get_memory_usage(pid) | |
`ps -o rss,vsz -p#{pid} | tail -n1`.chomp | |
end | |
puts "Initial Memory Usage: #{get_memory_usage(pid)}" | |
1000.times do | |
system %Q{wget -O/dev/null -o/dev/null #{url}} | |
end | |
puts "Final Memory Usage: #{get_memory_usage(pid)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment