Class: TuneMyGc::Spies::ActionController
- Defined in:
- lib/tunemygc/spies/action_controller.rb
Instance Attribute Summary collapse
-
#subscriptions ⇒ Object
readonly
Returns the value of attribute subscriptions.
Instance Method Summary collapse
-
#initialize ⇒ ActionController
constructor
A new instance of ActionController.
- #install ⇒ Object
- #uninstall ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ ActionController
Returns a new instance of ActionController.
34 35 36 37 |
# File 'lib/tunemygc/spies/action_controller.rb', line 34 def initialize super @subscriptions = [] end |
Instance Attribute Details
#subscriptions ⇒ Object (readonly)
Returns the value of attribute subscriptions.
32 33 34 |
# File 'lib/tunemygc/spies/action_controller.rb', line 32 def subscriptions @subscriptions end |
Instance Method Details
#install ⇒ Object
39 40 41 42 43 |
# File 'lib/tunemygc/spies/action_controller.rb', line 39 def install subscription(/^start_processing.action_controller$/, TuneMyGc::StartRequestSubscriber.new) subscription(/^process_action.action_controller$/, TuneMyGc::EndRequestSubscriber.new) TuneMyGc.log "hooked: action_controller" end |
#uninstall ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/tunemygc/spies/action_controller.rb', line 45 def uninstall TuneMyGc.uninstall_gc_tracepoint TuneMyGc.log "uninstalled GC tracepoint" @subscriptions.each{|s| ActiveSupport::Notifications.unsubscribe(s) } @subscriptions.clear TuneMyGc.log "uninstalled action_controller spy" end |