Created
March 28, 2013 17:56
-
-
Save vparihar01/5265402 to your computer and use it in GitHub Desktop.
Small piece of of code to check the memory stats for ruby on rails application, for any particular method.
This file contains hidden or 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
| require 'csv' | |
| def memstats | |
| size = `ps -o size= #{$$}`.strip.to_i | |
| end | |
| memstats | |
| test = CSV.read('test.csv', headers: true) | |
| test.count{|v| v['any_column'] = ~/any_text_in_that_column_to_search/} | |
| memstats |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment