Skip to content

Instantly share code, notes, and snippets.

@cheeyeo
Forked from orend/gist:5134300
Created May 25, 2014 16:55
Show Gist options
  • Save cheeyeo/e726ed93eb17c28766aa to your computer and use it in GitHub Desktop.
Save cheeyeo/e726ed93eb17c28766aa to your computer and use it in GitHub Desktop.
require 'csv'
def memstats
size = `ps -o size= #{$$}`.strip.to_i
end
memstats #4900
CSV.open('visitors.csv', headers: true) do |csv|
visitors = csv.each # Enumerator
memstats # 5164
visitors.count{|v| v['Geolocation'] =~ /San Francisco/}
end
memstats #5164
@cheeyeo
Copy link
Author

cheeyeo commented May 25, 2014

from episode 42 streaming of rubytapas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment