Sha256: 6eee7158ee62b304ed5c0e277db185707cb860b0ad7a939fbd1f66341ab194e3

Contents?: true

Size: 922 Bytes

Versions: 18

Compression:

Stored size: 922 Bytes

Contents

module AgentHooks
  # Used post fork to re-initialize state and restart communications with
  # the host agent.
  #
  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

  def before_resque_fork
    ::Instana.logger.debug "before_resque_fork hook called. pid/ppid: #{Process.pid}/#{Process.ppid}"
    @is_resque_worker = true
  end

  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
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
instana-1.10.3-java lib/instana/agent/hooks.rb
instana-1.10.3 lib/instana/agent/hooks.rb
instana-1.10.2-java lib/instana/agent/hooks.rb
instana-1.10.2 lib/instana/agent/hooks.rb
instana-1.10.1-java lib/instana/agent/hooks.rb
instana-1.10.1 lib/instana/agent/hooks.rb
instana-1.10.0 lib/instana/agent/hooks.rb
instana-1.10.0.slimfast lib/instana/agent/hooks.rb
instana-1.9.7 lib/instana/agent/hooks.rb
instana-1.9.6 lib/instana/agent/hooks.rb
instana-1.9.5 lib/instana/agent/hooks.rb
instana-1.9.4 lib/instana/agent/hooks.rb
instana-1.9.3 lib/instana/agent/hooks.rb
instana-1.9.2 lib/instana/agent/hooks.rb
instana-1.9.1 lib/instana/agent/hooks.rb
instana-1.9.0 lib/instana/agent/hooks.rb
instana-1.9.0.daftrabbit lib/instana/agent/hooks.rb
instana-1.9.0.sillyrabbit lib/instana/agent/hooks.rb