lib/contrast/utils/thread_tracker.rb in contrast-agent-3.12.2 vs lib/contrast/utils/thread_tracker.rb in contrast-agent-3.13.0
- old
+ new
@@ -3,19 +3,16 @@
module Contrast
module Utils
# ThreadTracker allows tracking of singleton objects across threads
class ThreadTracker
- def initialize logger = nil
- @logger = logger
- end
+ def initialize; end
# Note about Ruby -- thread#[] is fiber-local,
# #thread_variables is not.
def get key, default = nil
- log(key)
Thread.current[key] || default
end
def set key, value
Thread.current[key] = value
@@ -36,19 +33,9 @@
get(:current_context)
end
def update_current_context context
set(:current_context, context)
- end
-
- # logger may be nil so use this utility method instead
- def log key
- return unless @logger
- return unless @logger.debug?
-
- @logger.debug('Accessing object in Thread Tracker', name: key, p_id: Process.pid, thread_id: Thread.current.object_id)
- rescue StandardError
- false # NOOP
end
end
end
end