Module: NewRelic::ThreadLocalStorage
- Defined in:
- lib/new_relic/thread_local_storage.rb
Class Method Summary collapse
- .[](key) ⇒ Object
- .[]=(key, value) ⇒ Object
- .get(thread, key) ⇒ Object
- .set(thread, key, value) ⇒ Object
Class Method Details
permalink .[](key) ⇒ Object
[View source]
23 24 25 |
# File 'lib/new_relic/thread_local_storage.rb', line 23 def self.[](key) get(::Thread.current, key) end |
permalink .[]=(key, value) ⇒ Object
[View source]
27 28 29 |
# File 'lib/new_relic/thread_local_storage.rb', line 27 def self.[]=(key, value) set(::Thread.current, key, value) end |
permalink .get(thread, key) ⇒ Object
[View source]
7 8 9 10 11 12 13 |
# File 'lib/new_relic/thread_local_storage.rb', line 7 def self.get(thread, key) if Agent.config[:thread_local_tracer_state] thread.thread_variable_get(key) else thread[key] end end |
permalink .set(thread, key, value) ⇒ Object
[View source]
15 16 17 18 19 20 21 |
# File 'lib/new_relic/thread_local_storage.rb', line 15 def self.set(thread, key, value) if Agent.config[:thread_local_tracer_state] thread.thread_variable_set(key, value) else thread[key] = value end end |