Module: AgentHooks
- Included in:
- Instana::Agent
- Defined in:
- lib/instana/agent/hooks.rb
Instance Method Summary collapse
-
#after_fork ⇒ Object
Used post fork to re-initialize state and restart communications with the host agent.
- #after_resque_fork ⇒ Object
- #before_resque_fork ⇒ Object
Instance Method Details
#after_fork ⇒ Object
Used post fork to re-initialize state and restart communications with the host agent.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/instana/agent/hooks.rb', line 5 def after_fork ::Instana.logger.debug "after_fork hook called. Falling back to unannounced state and spawning a new background agent thread." # Reseed the random number generator for this # new thread. srand transition_to(:unannounced) setup spawn_background_thread end |
#after_resque_fork ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/instana/agent/hooks.rb', line 23 def after_resque_fork ::Instana.logger.debug "after_resque_fork hook called. pid/ppid: #{Process.pid}/#{Process.ppid}" # Reseed the random number generator for this # new thread. srand ::Instana.config[:metrics][:enabled] = false @process[:pid] = Process.pid setup spawn_background_thread end |