Created
October 24, 2018 08:58
-
-
Save m4rkw/1dcdbb3dfe63b29b5343b70a28ce1c5b 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 | |
require 'mechanize' | |
def meminfo | |
pid, size = `ps ax -o pid,rss | grep -E "^[[:space:]]*#{$$}"`.strip.split.map(&:to_i) | |
return size | |
end | |
x = 0 | |
while 1 | |
Mechanize.start do |mech| | |
mech.user_agent_alias = 'Mac Safari' | |
page = mech.get 'https://www.google.com' | |
end | |
m = meminfo | |
if m != x | |
x = m | |
p x | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment