Class: NewRelic::Agent::CrossAppPayload
- Inherits:
-
Object
- Object
- NewRelic::Agent::CrossAppPayload
- Defined in:
- lib/new_relic/agent/distributed_tracing/cross_app_payload.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#referring_guid ⇒ Object
readonly
Returns the value of attribute referring_guid.
-
#referring_path_hash ⇒ Object
readonly
Returns the value of attribute referring_path_hash.
-
#referring_trip_id ⇒ Object
readonly
Returns the value of attribute referring_trip_id.
-
#transaction ⇒ Object
readonly
Returns the value of attribute transaction.
Instance Method Summary collapse
- #as_json_array(content_length) ⇒ Object
-
#initialize(id, transaction, transaction_info) ⇒ CrossAppPayload
constructor
A new instance of CrossAppPayload.
Constructor Details
#initialize(id, transaction, transaction_info) ⇒ CrossAppPayload
Returns a new instance of CrossAppPayload.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 10 def initialize(id, transaction, transaction_info) @id = id @transaction = transaction transaction_info ||= [] @referring_guid = transaction_info[0] # unused_flag = transaction_info[1] @referring_trip_id = string_or_false_for(transaction_info[2]) @referring_path_hash = string_or_false_for(transaction_info[3]) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 8 def id @id end |
#referring_guid ⇒ Object (readonly)
Returns the value of attribute referring_guid.
8 9 10 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 8 def referring_guid @referring_guid end |
#referring_path_hash ⇒ Object (readonly)
Returns the value of attribute referring_path_hash.
8 9 10 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 8 def referring_path_hash @referring_path_hash end |
#referring_trip_id ⇒ Object (readonly)
Returns the value of attribute referring_trip_id.
8 9 10 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 8 def referring_trip_id @referring_trip_id end |
#transaction ⇒ Object (readonly)
Returns the value of attribute transaction.
8 9 10 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 8 def transaction @transaction end |
Instance Method Details
#as_json_array(content_length) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/new_relic/agent/distributed_tracing/cross_app_payload.rb', line 21 def as_json_array(content_length) queue_time_in_seconds = [transaction.queue_time, 0.0].max start_time_in_seconds = [transaction.start_time, 0.0].max app_time_in_seconds = Process.clock_gettime(Process::CLOCK_REALTIME) - start_time_in_seconds [ NewRelic::Agent.config[:cross_process_id], transaction.best_name, queue_time_in_seconds, app_time_in_seconds, content_length, transaction.guid, false ] end |