Class: NewRelic::Agent::TransactionSampleBuilder::PlaceholderSegment Private

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/transaction_sample_builder.rb

Overview

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.

Once we hit the TT segment limit, we use this class to hold our place in the tree so that we can still get accurate names and times on the segments we’ve already created. The placeholder segment keeps a depth counter that’s incremented on each segment entry, and decremented on exit, until it reaches zero, when we throw the placeholder away. There should only ever be zero or one placeholder segment at a time.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_segment) ⇒ PlaceholderSegment

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 PlaceholderSegment.



30
31
32
33
# File 'lib/new_relic/agent/transaction_sample_builder.rb', line 30

def initialize(parent_segment)
  @parent_segment = parent_segment
  @depth = 1
end

Instance Attribute Details

#depthObject

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.



28
29
30
# File 'lib/new_relic/agent/transaction_sample_builder.rb', line 28

def depth
  @depth
end

#parent_segmentObject (readonly)

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.



27
28
29
# File 'lib/new_relic/agent/transaction_sample_builder.rb', line 27

def parent_segment
  @parent_segment
end

Instance Method Details

#[](key) ⇒ 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.

No-op - some clients expect to be able to use this to read params from TT segments.



41
# File 'lib/new_relic/agent/transaction_sample_builder.rb', line 41

def [](key); end

#[]=(key, value) ⇒ 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.

No-op - some clients expect to be able to use this to attach params to TT segments.



37
# File 'lib/new_relic/agent/transaction_sample_builder.rb', line 37

def []=(key, value); end