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
require 'benchmark' | |
module Kernel | |
alias old_require require | |
def require(path) | |
#unless caller.find { |caller_line| caller_line.match /dependencies\.rb/ } | |
# return old_require(path) | |
#end |
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
# | |
# Created by Eric Lindvall <[email protected]> | |
# | |
# WHAT: Provides a simple overview of memory allocation occuring during a | |
# require. | |
# | |
# For a longer explanation, see my post at: | |
# | |
# http://bitmonkey.net/post/308322913/tracking-initial-memory-usage-by-file-in-ruby | |
# |
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
# ACK: | |
# modified from | |
# http://gist.github.com/264496 | |
# http://gist.github.com/465293 | |
# USAGE: | |
# 1) > ruby -rrequire_tracking -e "require 'active_support'" | |
# 2) put in config/preinitializer.rb | |
# WHAT: Provides a simple overview of memory allocation occuring |
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
# ACK: | |
# modified from | |
# http://gist.github.com/264496 by github.com/eric | |
# http://gist.github.com/465293 by github.com/alexyoung | |
# USAGE: | |
# 1) > ruby -rrequire_tracking -e "require 'active_support'" | |
# 2) put in config/preinitializer.rb | |
# WHAT: Provides a simple overview of memory allocation occuring |
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
# using memcache hosted on other-than localhost:11311 - needs better documentation | |
Rails::Initializer.run do |config| | |
config.cache_store = :mem_cache_store, '72.14.x.y:11311' | |
ActionController::Base.session = { | |
:key => '_foo_session', | |
:secret => 'secret', | |
:memcache_server => '72.14.x.y:11311' | |
} |
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
# using memcache hosted on other-than localhost:11311 - needs better documentation | |
Rails::Initializer.run do |config| | |
config.cache_store = :mem_cache_store, '72.14.x.y:11311' | |
ActionController::Base.session = { | |
:key => '_foo_session', | |
:secret => 'secret', | |
:memcache_server => '72.14.x.y:11311' | |
} |
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
#!/bin/bash | |
# collectd plugin to monitor passenger | |
# has better memory-requirement than a ruby script | |
# TODO: try writing it in c - if it makes a difference | |
HOSTNAME="production-host-01" | |
INTERVAL="${COLLECTD_INTERVAL:-10}" | |
PLUGIN_NAME="passenger_status" | |
while sleep "$INTERVAL" |
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
/home/deepak/.rvm/rubies/ree-1.8.7-2010.01/bin/ruby extconf.rb | |
checking for main() in -lyajl_ext... yes | |
checking for json/json_gen.h... yes | |
checking for gelf_getshdr() in -lelf_ext... yes | |
checking for main() in -ldwarf_ext... yes | |
checking for mach-o/dyld.h... no | |
creating Makefile | |
make | |
gcc -I. -I/home/deepak/.rvm/gems/ree-1.8.7-2010.01/gems/memprof-0.3.5/ext/dst/include -I/home/deepak/.rvm/gems/ree-1.8.7-2010.01/gems/memprof-0.3.5/ext/dst/include -I. -I/home/deepak/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/i686-linux -I. -DHAVE_JSON_JSON_GEN_H -DHAVE_ELF -DHAVE_DWARF -D_ARCH_i686_ -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -o tramp.o -c tramp.c |
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 'benchmark' | |
require 'rubygems' | |
require 'nokogiri' | |
require 'yajl' | |
require 'active_support' | |
ActiveSupport::XmlMini.backend='Nokogiri' | |
require 'active_resource' |
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
deepak@octo:~/src/work/entsupport$ ruby -dw ./script/console | |
Exception `LoadError' at /home/deepak/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:1113 - no such file to load -- rubygems/defaults/operating_system | |
Exception `LoadError' at /home/deepak/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:1122 - no such file to load -- rubygems/defaults/ruby | |
Exception `LoadError' at /home/deepak/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:50 - no such file to load -- Win32API | |
Exception `LoadError' at /home/deepak/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- ruby-debug | |
Exception `LoadError' at /home/deepak/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- methodsig | |
Exception `LoadError' at /home/deepak/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:38 - no such file to load -- methodsig | |
Exception ` |