Class: OneApm::TransactionSampleBuilder::PlaceholderSegment Private
- Inherits:
-
Object
- Object
- OneApm::TransactionSampleBuilder::PlaceholderSegment
- Defined in:
- lib/one_apm/transaction/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
- #depth ⇒ Object private
- #parent_segment ⇒ Object readonly private
Instance Method Summary collapse
-
#[](key) ⇒ Object
private
No-op - some clients expect to be able to use these to read/write params on TT segments.
- #[]=(key, value) ⇒ Object private
-
#initialize(parent_segment) ⇒ PlaceholderSegment
constructor
private
A new instance of PlaceholderSegment.
-
#params ⇒ Object
private
Stubbed out in case clients try to touch params directly.
- #params= ⇒ Object private
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.
27 28 29 30 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 27 def initialize(parent_segment) @parent_segment = parent_segment @depth = 1 end |
Instance Attribute Details
#depth ⇒ 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.
25 26 27 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 25 def depth @depth end |
#parent_segment ⇒ Object (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.
24 25 26 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 24 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 these to read/write params on TT segments.
34 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 34 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.
35 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 35 def []=(key, value); end |
#params ⇒ 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.
Stubbed out in case clients try to touch params directly.
38 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 38 def params; {}; end |
#params= ⇒ 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.
39 |
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 39 def params=; end |