Skip to content

Instantly share code, notes, and snippets.

@vinh0604
Last active December 28, 2015 16:08
Show Gist options
  • Select an option

  • Save vinh0604/7526334 to your computer and use it in GitHub Desktop.

Select an option

Save vinh0604/7526334 to your computer and use it in GitHub Desktop.
counts = Hash.new(0)
ObjectSpace.each_object do |o|
next unless (o.class == String)
counts[o[0,60]] += 1
end
counts = counts.to_a.sort_by(&:last);
puts counts[-10..-1]
puts Process.pid
# results
"PricingRule Exists: SELECT"
74632
": SELECT COUNT(*) FROM `re"
85454
"CACHE: SELECT `companies`"
93045
"PricingRule Load: SELECT "
114169
"Page Load: SELECT `pages`"
140245
": SELECT COUNT(*) FROM `pa"
182274
"Customer Load: SELECT `cu"
191972
"Company Load: SELECT `com"
253025
"Page Load: SELECT `pages`."
320267
"DestinationCountry Load: S"
413299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment