Public Gists by eric

Gravatar
Wed Nov 25 15:36:37 -0800 2009
1
2
3
#!/usr/bin/env ruby
 
def fork_test(command)
gist: 242966 Based on a great idea from ...
Gravatar
Wed Nov 25 11:41:13 -0800 2009
1
2
3
diff --git a/lib/god/process.rb b/lib/god/process.rb
index 338da5e..6cbc867 100644
--- a/lib/god/process.rb
Gravatar
Mon Nov 23 09:56:28 -0800 2009
1
2
3
(gdb) ruby objects classes
       1 YAML::Syck::Resolver
       1 YAML::Syck::Resolver
Gravatar
Thu Nov 19 12:27:10 -0800 2009
1
2
3
diff --git a/lib/god/logger.rb b/lib/god/logger.rb
index 7c45679..b08d0f8 100644
--- a/lib/god/logger.rb
Gravatar
Fri Nov 13 23:52:36 -0800 2009
1
2
3
[9 : 0] eric@kiccoro:/Users/eric/src > ruby thread_sender.rb
testing 1: #<Thread:0x101419bf8 run>
testing 2: #<Thread:0x101419bf8 run>
Gravatar
Wed Nov 04 20:06:07 -0800 2009
1
2
3
require 'open3'
 
module ShellJob
Gravatar
Tue Oct 27 16:12:41 -0700 2009
1
2
3
$null = File.open('/dev/null', 'w')
 
threads = []
Gravatar
Mon Oct 26 23:29:41 -0700 2009
1
2
3
CRYPT [99 : 0] eric@kibo:/home/eric/god-memory-testing > pprof --text /usr/bin/ruby --base=god-3.hprof.0001.heap god-3.hprof.0002.heap
Total: 1.4 MB
     1.0 72.0% 72.0% 1.0 72.0% ruby_xmalloc
Gravatar
Mon Oct 26 23:21:31 -0700 2009
1
2
3
CRYPT [93 : 0] eric@kibo:/home/eric/god-memory-testing > pprof --text /usr/bin/ruby god-2.hprof.0004.heap
Total: 7.9 MB
     5.3 66.7% 66.7% 5.3 66.7% add_heap
Gravatar
Mon Oct 26 23:19:35 -0700 2009
1
2
3
Displaying top 20 most common line/class pairs
109371 total objects
109371 filled heap slots
Gravatar
Mon Oct 26 22:44:04 -0700 2009
1
2
3
WATCHERS = 10
 
# Make sure pid directories exists
gist: 219071 NewRelic instrumentation fo...
Gravatar
Mon Oct 26 14:41:36 -0700 2009
1
2
3
# NewRelic instrumentation for ThinkingSphinx
if defined? ActiveRecord
  ActiveRecord::Base.class_eval do
Gravatar
Mon Oct 26 11:47:39 -0700 2009
1
2
3
Thread ID: 9261400
Total: 250423 Kb
 
gist: 218840 A ruby-prof printer to use ...
Gravatar
Mon Oct 26 10:31:33 -0700 2009
1
2
3
class MemoryPrinter < RubyProf::AbstractPrinter
  # Print a flat profile report to the provided output.
  #
Gravatar
Sun Oct 25 20:45:16 -0700 2009
1
2
3
 > ps auxww | grep timeout-test ; sleep 1 ; ps auxww | grep timeout-test
eric 29741 92.1 5.2 66660 27444 pts/4 R+ 20:50 0:38 ruby timeout-test.rb
eric 29741 92.2 5.2 66656 27708 pts/4 R+ 20:50 0:39 ruby timeout-test.rb
Gravatar
Sun Oct 25 19:00:12 -0700 2009
1
2
3
Thread ID: 16553080
Total: 33 Kb
 
Gravatar
Sat Oct 24 19:15:05 -0700 2009
1
2
3
$:.unshift "#{File.dirname(__FILE__)}/lib"
 
require 'ostruct'
gist: 216414 Simple mechanism to make su...
Gravatar
Thu Oct 22 15:44:08 -0700 2009
1
2
3
# This relies on god 0.7.22 or later.
#
# Restart god when it reaches 40MB
Gravatar
Thu Oct 22 13:04:39 -0700 2009
1
2
3
# Want to use your own storage-conf.xml instead of the one included with
# the cassandra gem?
#
Gravatar
Tue Oct 13 23:17:52 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
# Riddle at http://bt.tumblr.com/post/212634688