Class: OneApm::TransactionSampleBuilder::PlaceholderSegment Private

Inherits:
Object
  • Object
show all
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.

API:

  • private

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.

API:

  • private



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

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

API:

  • private



25
26
27
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 25

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.

API:

  • private



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.

API:

  • private



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.

API:

  • private



35
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 35

def []=(key, value); end

#paramsObject

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.

API:

  • private



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.

API:

  • private



39
# File 'lib/one_apm/transaction/transaction_sample_builder.rb', line 39

def params=; end