Class: ScoutApm::RequestManager
- Inherits:
-
Object
- Object
- ScoutApm::RequestManager
- Defined in:
- lib/scout_apm/request_manager.rb
Class Method Summary collapse
-
.create ⇒ Object
Create a new TrackedRequest object for this thread.
-
.find ⇒ Object
Get the current Thread local, and detecting, and not returning a stale request.
- .lookup ⇒ Object
Class Method Details
.create ⇒ Object
Create a new TrackedRequest object for this thread
22 23 24 |
# File 'lib/scout_apm/request_manager.rb', line 22 def self.create Thread.current[:scout_request] = TrackedRequest.new end |
.find ⇒ Object
Get the current Thread local, and detecting, and not returning a stale request
11 12 13 14 15 16 17 18 19 |
# File 'lib/scout_apm/request_manager.rb', line 11 def self.find req = Thread.current[:scout_request] if req && req.recorded? nil else req end end |
.lookup ⇒ Object
6 7 8 |
# File 'lib/scout_apm/request_manager.rb', line 6 def self.lookup find || create end |