Sha256: 036c73ea4c01427af9977968f7dcd6fde32fdd8e514d2c6848f330aef9754069
Contents?: true
Size: 1.22 KB
Versions: 15
Compression:
Stored size: 1.22 KB
Contents
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. module NewRelic module Agent module Threading class AgentThread < ::Thread def initialize(label) ::NewRelic::Agent.logger.debug("Creating New Relic thread: #{label}") self[:newrelic_label] = label super end def self.bucket_thread(thread, profile_agent_code) if thread.key?(:newrelic_label) profile_agent_code ? :agent : :ignore elsif TransactionState.in_background_transaction?(thread) :background elsif TransactionState.in_request_transaction?(thread) :request else :other end end def self.scrub_backtrace(thread, profile_agent_code) begin bt = thread.backtrace rescue Exception => e ::NewRelic::Agent.logger.debug("Failed to backtrace #{thread.inspect}: #{e.class.name}: #{e.to_s}") end return nil unless bt bt.reject! { |t| t.include?('/newrelic_rpm-') } unless profile_agent_code bt end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems