Sha256: 1638c0c973b5932268500fe6b5246c68ede2b74e6bd6a65cd8387182c392f0de
Contents?: true
Size: 1010 Bytes
Versions: 39
Compression:
Stored size: 1010 Bytes
Contents
# encoding: utf-8 module OneApm module Agent class Harvester attr_accessor :starting_pid def initialize(events, after_forker = OneApm::Manager) @starting_pid = nil @after_forker = after_forker if events events.subscribe(:start_transaction, &method(:on_transaction)) end end def on_transaction(*_) return unless restart_in_children_enabled? && needs_restart? && harvest_thread_enabled? restart_harvest_thread end def mark_started(pid = Process.pid) @starting_pid = pid end def needs_restart?(pid = Process.pid) @starting_pid != pid end def restart_in_children_enabled? OneApm::Manager.config[:restart_thread_in_children] end def harvest_thread_enabled? !OneApm::Manager.config[:disable_harvest_thread] end def restart_harvest_thread @after_forker.after_fork(:force_reconnect => true) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems