Class: StackifyRubyAPM::Context::Response Private
- Inherits:
-
Object
- Object
- StackifyRubyAPM::Context::Response
- Includes:
- NaivelyHashable
- Defined in:
- lib/stackify_apm/context/response.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #finished ⇒ Object private
- #headers ⇒ Object private
- #headers_sent ⇒ Object private
- #status_code ⇒ Object private
Instance Method Summary collapse
-
#initialize(status_code, headers: {}, headers_sent: true, finished: true) ⇒ Response
constructor
private
A new instance of Response.
- #make_xstackify_id_header(headers) ⇒ Object private
Methods included from NaivelyHashable
Constructor Details
#initialize(status_code, headers: {}, headers_sent: true, finished: true) ⇒ Response
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Response.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/stackify_apm/context/response.rb', line 9 def initialize( status_code, headers: {}, headers_sent: true, finished: true ) @status_code = status_code headers = make_xstackify_id_header(headers) @headers = headers @headers_sent = headers_sent @finished = finished end |
Instance Attribute Details
#finished ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/stackify_apm/context/response.rb', line 22 def finished @finished end |
#headers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/stackify_apm/context/response.rb', line 22 def headers @headers end |
#headers_sent ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/stackify_apm/context/response.rb', line 22 def headers_sent @headers_sent end |
#status_code ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/stackify_apm/context/response.rb', line 22 def status_code @status_code end |
Instance Method Details
#make_xstackify_id_header(headers) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 30 |
# File 'lib/stackify_apm/context/response.rb', line 24 def make_xstackify_id_header(headers) return unless StackifyRubyAPM.agent.current_transaction && StackifyRubyAPM.agent.current_transaction.id transaction_id = StackifyRubyAPM.agent.current_transaction.id client_id = StackifyRubyAPM.agent.config.client_id device_id = StackifyRubyAPM.agent.config.device_id headers['X-StackifyID'] = "V1|#{transaction_id}|#{client_id}|#{device_id}" if client_id && device_id end |