Class: HeimdallApm::TransactionManager
- Inherits:
-
Object
- Object
- HeimdallApm::TransactionManager
- Defined in:
- lib/heimdall_apm/transaction_manager.rb
Overview
Handles the thread-local variable holding the current tracked transaction, populating it the first time it is accessed.
Class Method Summary collapse
Class Method Details
.create ⇒ Object
22 23 24 25 |
# File 'lib/heimdall_apm/transaction_manager.rb', line 22 def self.create context = Agent.instance.context Thread.current[:heimdall_request] = ::HeimdallApm::TrackedTransaction.new(context) end |
.current ⇒ Object
8 9 10 |
# File 'lib/heimdall_apm/transaction_manager.rb', line 8 def self.current find || create end |
.find ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/heimdall_apm/transaction_manager.rb', line 12 def self.find req = Thread.current[:heimdall_request] if !req || req.stopped? nil else req end end |