Skip to content

Instantly share code, notes, and snippets.

@jessereynolds
Created July 26, 2013 00:57
Show Gist options
  • Save jessereynolds/6085193 to your computer and use it in GitHub Desktop.
Save jessereynolds/6085193 to your computer and use it in GitHub Desktop.
by cpu time
(again run for about 70 seconds and killed)
jesse@Heart-of-Gold flapjack $ CPUPROFILE=/tmp/flapjack_profile_3 RUBYOPT="-r`gem which perftools | tail -1`" bin/flapjack start --no-daemonize
Flapjack starting...Starting flapjack service...
2013-07-26T10:24:51+09:30 [INFO] :: flapjack-jabber :: starting
2013-07-26T10:24:51+09:30 [INFO] :: flapjack-web :: starting web - class
2013-07-26T10:24:51+09:30 [INFO] :: flapjack-api :: starting api - class
2013-07-26T10:24:52+09:30 [INFO] :: flapjack-jabber :: Jabber Connected
2013-07-26T10:24:52+09:30 [INFO] :: flapjack-jabber :: Joining room [email protected]
2013-07-26T10:24:52+09:30 [INFO] :: flapjack-jabber :: Joining room [email protected]
^C2013-07-26T10:25:49+09:30 [INFO] :: flapjack-coordinator :: notifier: stopping -> stopped
2013-07-26T10:25:49+09:30 [INFO] :: flapjack-coordinator :: jabber: stopping -> stopped
2013-07-26T10:25:49+09:30 [INFO] :: flapjack-coordinator :: web: stopping -> stopped
2013-07-26T10:25:49+09:30 [INFO] :: flapjack-coordinator :: api: stopping -> stopped
2013-07-26T10:25:49+09:30 [WARN] :: flapjack-jabber :: disconnect handler called
2013-07-26T10:25:49+09:30 [INFO] :: flapjack-coordinator :: processor: stopping -> stopped
done.
PROFILE: interrupts/evictions/bytes = 4464/0/28472
jesse@Heart-of-Gold flapjack $ pprof.rb --text /tmp/flapjack_profile_3
Using local file /Users/jesse/.rbenv/versions/1.9.3-p125/bin/ruby.
Using local file /tmp/flapjack_profile_3.
Total: 4464 samples
2299 51.5% 51.5% 2308 51.7% EventMachine.run_machine
905 20.3% 71.8% 905 20.3% garbage_collector
877 19.6% 91.4% 877 19.6% Syslog.log
204 4.6% 96.0% 204 4.6% File.file?
61 1.4% 97.4% 292 6.5% Kernel#gem_original_require
18 0.4% 97.8% 104 2.3% Class#each
11 0.2% 98.0% 196 4.4% Gem::Specification#contains_requirable_file?
7 0.2% 98.2% 7 0.2% String#scan
6 0.1% 98.3% 19 0.4% EventMachine::Synchrony::ConnectionPool#method_missing
4 0.1% 98.4% 10 0.2% Kernel#eval
3 0.1% 98.5% 9 0.2% Array#map
3 0.1% 98.5% 4 0.1% EventMachine::Synchrony::ConnectionPool#acquire
3 0.1% 98.6% 3 0.1% Hash#values
3 0.1% 98.7% 3 0.1% Nokogiri::XML::XPathContext.new
2 0.0% 98.7% 17 0.4% Array#flatten
2 0.0% 98.7% 2 0.0% Array#join
2 0.0% 98.8% 3 0.1% Class#find_by_name
2 0.0% 98.8% 2 0.0% EventMachine.send_data
2 0.0% 98.9% 3 0.1% EventMachine::Deferrable#set_deferred_status
2 0.0% 98.9% 2 0.0% File#initialize
2 0.0% 99.0% 2 0.0% File.directory?
2 0.0% 99.0% 2 0.0% File.read
2 0.0% 99.1% 4 0.1% Flapjack::Data::EntityCheck#last_change
2 0.0% 99.1% 2 0.0% Nokogiri::XML::Node#add_child_node
2 0.0% 99.1% 2 0.0% Regexp#=~
2 0.0% 99.2% 2 0.0% String#gsub
2 0.0% 99.2% 2 0.0% Time#initialize
1 0.0% 99.3% 1 0.0% Array#select
1 0.0% 99.3% 1 0.0% BasicObject#initialize
1 0.0% 99.3% 7 0.2% Class#create
1 0.0% 99.3% 1 0.0% Dir.[]
1 0.0% 99.4% 1 0.0% Encoding.find
1 0.0% 99.4% 3 0.1% Enumerable#each_with_index
1 0.0% 99.4% 1 0.0% Enumerable#sort_by
1 0.0% 99.4% 3 0.1% EventMachine::Deferrable#callback
1 0.0% 99.4% 1 0.0% EventMachine::Deferrable#cancel_timeout
1 0.0% 99.5% 2 0.0% Flapjack::Data::EntityCheck#last_update=
1 0.0% 99.5% 4 0.1% Flapjack::Data::EntityCheck#update_state
1 0.0% 99.5% 328 7.3% Flapjack::Filters::Ok#block?
1 0.0% 99.5% 21 0.5% Flapjack::Processor#update_keys
1 0.0% 99.6% 1 0.0% Hash#[]=
1 0.0% 99.6% 1 0.0% Hash#invert
1 0.0% 99.6% 1 0.0% Kernel#`
1 0.0% 99.6% 1 0.0% Kernel#is_a?
1 0.0% 99.6% 4 0.1% Kernel#loop
1 0.0% 99.7% 2 0.0% MIME::Type#initialize
1 0.0% 99.7% 1 0.0% MIME::Types#add
1 0.0% 99.7% 1 0.0% Marshal.load
1 0.0% 99.7% 1 0.0% Module#remove_method
1 0.0% 99.8% 1 0.0% Module#sync
1 0.0% 99.8% 9 0.2% MonitorMixin#mon_synchronize
1 0.0% 99.8% 1 0.0% Mutex#sleep
1 0.0% 99.8% 2 0.0% Mutex#synchronize
1 0.0% 99.8% 1 0.0% Nokogiri::XML::Node#dup
1 0.0% 99.9% 1 0.0% Nokogiri::XML::XPathContext#evaluate
1 0.0% 99.9% 1 0.0% Process.pid
1 0.0% 99.9% 1 0.0% String#split
1 0.0% 99.9% 1 0.0% String#to_i
1 0.0% 100.0% 1 0.0% Symbol#to_s
1 0.0% 100.0% 1 0.0% Thin::Backends::TcpServer#connect
1 0.0% 100.0% 1 0.0% Time.allocate
0 0.0% 100.0% 4 0.1% ActiveSupport::XmlMini#backend=
0 0.0% 100.0% 2 0.0% Actor#_receive
0 0.0% 100.0% 5 0.1% Actor#initialize
0 0.0% 100.0% 5 0.1% Actor#watchdog
0 0.0% 100.0% 5 0.1% Actor.private_new
0 0.0% 100.0% 3 0.1% Array#map!
0 0.0% 100.0% 165 3.7% Array#reverse_each
0 0.0% 100.0% 1 0.0% Blather::Client#call_handler
0 0.0% 100.0% 1 0.0% Blather::Client#call_handler_for
0 0.0% 100.0% 1 0.0% Blather::Client#guarded?
0 0.0% 100.0% 3 0.1% Blather::Client#handle_data
0 0.0% 100.0% 3 0.1% Blather::Client#handle_stanza
0 0.0% 100.0% 2 0.0% Blather::Roster#process
0 0.0% 100.0% 1 0.0% Blather::RosterItem#initialize
0 0.0% 100.0% 1 0.0% Blather::Stanza::Iq::Query#inherit
0 0.0% 100.0% 2 0.0% Blather::Stanza::Iq::Roster#inherit
0 0.0% 100.0% 1 0.0% Blather::Stanza::Iq::Roster#items
0 0.0% 100.0% 1 0.0% Blather::Stanza::Iq::Roster::RosterItem#groups
0 0.0% 100.0% 1 0.0% Blather::Stanza::MUC::MUCUserBase#inherit
0 0.0% 100.0% 1 0.0% Blather::Stanza::MUC::MUCUserBase#muc_user
0 0.0% 100.0% 1 0.0% Blather::Stanza::Message#body
0 0.0% 100.0% 1 0.0% Blather::Stanza::Message#chat_state=
0 0.0% 100.0% 1 0.0% Blather::Stanza::Message#inherit
0 0.0% 100.0% 5 0.1% Blather::Stream#receive
0 0.0% 100.0% 5 0.1% Blather::Stream#receive_data
0 0.0% 100.0% 5 0.1% Blather::Stream::Parser#deliver
0 0.0% 100.0% 5 0.1% Blather::Stream::Parser#end_element_namespace
0 0.0% 100.0% 5 0.1% Blather::Stream::Parser#receive_data
0 0.0% 100.0% 5 0.1% Blather::XMPPNode#to_stanza
0 0.0% 100.0% 3 0.1% Class#[]
0 0.0% 100.0% 34 0.8% Class#_all
0 0.0% 100.0% 1 0.0% Class#add
0 0.0% 100.0% 1 0.0% Class#compile
0 0.0% 100.0% 1 0.0% Class#compile!
0 0.0% 100.0% 54 1.2% Class#find_by_path
0 0.0% 100.0% 10 0.2% Class#find_in_unresolved
0 0.0% 100.0% 173 3.9% Class#find_in_unresolved_tree
0 0.0% 100.0% 3 0.1% Class#for_event_id
0 0.0% 100.0% 1 0.0% Class#get
0 0.0% 100.0% 1 0.0% Class#handler_hierarchy=
0 0.0% 100.0% 5 0.1% Class#import
0 0.0% 100.0% 3 0.1% Class#lazy_zones_map
0 0.0% 100.0% 33 0.7% Class#load
0 0.0% 100.0% 5 0.1% Class#load_from_file
0 0.0% 100.0% 3 0.1% Class#next
0 0.0% 100.0% 2 0.0% Class#parse
0 0.0% 100.0% 1 0.0% Class#pending_count
0 0.0% 100.0% 2 0.0% Class#receive
0 0.0% 100.0% 2 0.0% Class#register
0 0.0% 100.0% 3 0.1% Class#require_tzinfo
0 0.0% 100.0% 1 0.0% Class#route
0 0.0% 100.0% 1 0.0% Class#simplified
0 0.0% 100.0% 7 0.2% Comparable#<
0 0.0% 100.0% 2 0.0% Comparable#>=
0 0.0% 100.0% 2593 58.1% Dante::Runner#execute
0 0.0% 100.0% 2593 58.1% Dante::Runner#start
0 0.0% 100.0% 9 0.2% Enumerable#all?
0 0.0% 100.0% 413 9.3% Enumerable#find
0 0.0% 100.0% 12 0.3% Enumerable#find_all
0 0.0% 100.0% 1 0.0% Enumerable#inject
0 0.0% 100.0% 1 0.0% Enumerable#map
0 0.0% 100.0% 2 0.0% EventMachine::Connection#send_data
0 0.0% 100.0% 3 0.1% EventMachine::Deferrable#succeed
0 0.0% 100.0% 13 0.3% EventMachine::Synchrony::ConnectionPool#execute
0 0.0% 100.0% 3 0.1% File.open
0 0.0% 100.0% 6 0.1% Flapjack::Coordinator#add_pikelets
0 0.0% 100.0% 2308 51.7% Flapjack::Coordinator#start
0 0.0% 100.0% 1 0.0% Flapjack::Data::EntityCheck#last_notification
0 0.0% 100.0% 1 0.0% Flapjack::Data::EntityCheck#last_notification_for_state
0 0.0% 100.0% 1 0.0% Flapjack::Data::EntityCheck#last_notifications_of_each_type
0 0.0% 100.0% 1 0.0% Flapjack::Data::Event#client
0 0.0% 100.0% 6 0.1% Flapjack::Filters::ScheduledMaintenance#block?
0 0.0% 100.0% 3 0.1% Flapjack::Notifier#initialize
0 0.0% 100.0% 4 0.1% Flapjack::Pikelet::Generic#initialize
0 0.0% 100.0% 1 0.0% Flapjack::Pikelet::Thin#start
0 0.0% 100.0% 1 0.0% Flapjack::Processor#initialize
0 0.0% 100.0% 852 19.1% Flapjack::Processor#process_event
0 0.0% 100.0% 909 20.4% Flapjack::Processor#start
0 0.0% 100.0% 3 0.1% Flapjack::Processor#touch_keys
0 0.0% 100.0% 2 0.0% Gem::Dependency#initialize
0 0.0% 100.0% 12 0.3% Gem::Dependency#matching_specs
0 0.0% 100.0% 12 0.3% Gem::Dependency#to_specs
0 0.0% 100.0% 2 0.0% Gem::Requirement#initialize
0 0.0% 100.0% 9 0.2% Gem::Requirement#satisfied_by?
0 0.0% 100.0% 1 0.0% Gem::Specification#activate
0 0.0% 100.0% 1 0.0% Gem::Specification#activate_dependencies
0 0.0% 100.0% 4 0.1% Gem::Specification#add_dependency_with_type
0 0.0% 100.0% 3 0.1% Gem::Specification#add_development_dependency
0 0.0% 100.0% 1 0.0% Gem::Specification#add_runtime_dependency
0 0.0% 100.0% 4 0.1% Gem::Specification#conflicts
0 0.0% 100.0% 2 0.0% Gem::Specification#full_gem_path
0 0.0% 100.0% 6 0.1% Gem::Specification#initialize
0 0.0% 100.0% 1 0.0% Gem::Specification#runtime_dependencies
0 0.0% 100.0% 165 3.7% Gem::Specification#traverse
0 0.0% 100.0% 9 0.2% Gem::Version#<=>
0 0.0% 100.0% 2 0.0% Gem::Version#bump
0 0.0% 100.0% 9 0.2% Gem::Version#segments
0 0.0% 100.0% 1 0.0% Hash#each
0 0.0% 100.0% 5 0.1% Hash#each_pair
0 0.0% 100.0% 2 0.0% Integer#upto
0 0.0% 100.0% 3 0.1% Kernel#catch
0 0.0% 100.0% 333 7.5% Kernel#require
0 0.0% 100.0% 1 0.0% Module#class_eval
0 0.0% 100.0% 5 0.1% Module#create
0 0.0% 100.0% 1 0.0% Module#registered
0 0.0% 100.0% 1 0.0% Module#remove_possible_method
0 0.0% 100.0% 2308 51.7% Module#run
0 0.0% 100.0% 2308 51.7% Module#synchrony
0 0.0% 100.0% 56 1.3% Module#try_activate
0 0.0% 100.0% 2 0.0% MultiJson#adapter
0 0.0% 100.0% 2 0.0% MultiJson#load_adapter
0 0.0% 100.0% 2 0.0% MultiJson#use
0 0.0% 100.0% 1 0.0% Niceogiri::XML::Node#content_from
0 0.0% 100.0% 2 0.0% Niceogiri::XML::Node#inherit
0 0.0% 100.0% 2 0.0% Niceogiri::XML::Node#inherit_children
0 0.0% 100.0% 1 0.0% Niceogiri::XML::Node#read_content
0 0.0% 100.0% 2 0.0% Nokogiri::XML::Node#<<
0 0.0% 100.0% 2 0.0% Nokogiri::XML::Node#add_child
0 0.0% 100.0% 2 0.0% Nokogiri::XML::Node#add_child_node_and_reparent_attrs
0 0.0% 100.0% 1 0.0% Nokogiri::XML::Node#find_first
0 0.0% 100.0% 5 0.1% Nokogiri::XML::Node#xpath
0 0.0% 100.0% 2 0.0% Nokogiri::XML::NodeSet#each
0 0.0% 100.0% 5 0.1% Nokogiri::XML::SAX::PushParser#native_write
0 0.0% 100.0% 5 0.1% Nokogiri::XML::SAX::PushParser#write
0 0.0% 100.0% 1 0.0% OptionParser#define
0 0.0% 100.0% 1 0.0% OptionParser#initialize
0 0.0% 100.0% 1 0.0% OptionParser#on
0 0.0% 100.0% 1 0.0% OptionParser::List#append
0 0.0% 100.0% 1 0.0% OptionParser::List#update
0 0.0% 100.0% 156 3.5% Proc#[]
0 0.0% 100.0% 1 0.0% Queue#pop
0 0.0% 100.0% 1 0.0% Queue#push
0 0.0% 100.0% 1 0.0% Redis#brpoplpush
0 0.0% 100.0% 3 0.1% Redis#expire
0 0.0% 100.0% 2 0.0% Redis#get
0 0.0% 100.0% 1 0.0% Redis#hincrby
0 0.0% 100.0% 1 0.0% Redis#hset
0 0.0% 100.0% 1 0.0% Redis#llen
0 0.0% 100.0% 9 0.2% Redis#synchronize
0 0.0% 100.0% 8 0.2% Redis::Client#call
0 0.0% 100.0% 1 0.0% Redis::Client#call_without_timeout
0 0.0% 100.0% 8 0.2% Redis::Client#ensure_connected
0 0.0% 100.0% 7 0.2% Redis::Client#io
0 0.0% 100.0% 8 0.2% Redis::Client#logging
0 0.0% 100.0% 8 0.2% Redis::Client#process
0 0.0% 100.0% 2 0.0% Redis::Client#read
0 0.0% 100.0% 1 0.0% Redis::Client#without_socket_timeout
0 0.0% 100.0% 5 0.1% Redis::Client#write
0 0.0% 100.0% 2 0.0% Redis::Connection::CommandHelper#build_command
0 0.0% 100.0% 2 0.0% Redis::Connection::RedisClient#read
0 0.0% 100.0% 4 0.1% Redis::Connection::RedisClient#receive_data
0 0.0% 100.0% 2 0.0% Redis::Connection::Synchrony#read
0 0.0% 100.0% 5 0.1% Redis::Connection::Synchrony#write
0 0.0% 100.0% 1 0.0% Thin::Backends::Base#start
0 0.0% 100.0% 1 0.0% Thin::Server#start
0 0.0% 100.0% 3 0.1% Time.now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment