Class: StackifyRubyAPM::Span Private
- Inherits:
-
Object
- Object
- StackifyRubyAPM::Span
- Defined in:
- lib/stackify_apm/span.rb,
lib/stackify_apm/span/context.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.
Defined Under Namespace
Classes: Context
Constant Summary collapse
- DEFAULT_TYPE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'custom'.freeze
Instance Attribute Summary collapse
- #context ⇒ Object readonly private
- #duration ⇒ Object readonly private
-
#http_status ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
- #id ⇒ Object readonly private
-
#name ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
-
#original_backtrace ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
- #parent_id ⇒ Object readonly private
- #relative_end ⇒ Object readonly private
- #relative_start ⇒ Object readonly private
- #stacktrace ⇒ Object readonly private
-
#type ⇒ Object
private
rubocop:enable Metrics/ParameterLists.
Instance Method Summary collapse
- #done ⇒ Object private
- #done? ⇒ Boolean private
-
#initialize(transaction, id, name, type = nil, parent_id: nil, context: nil, http_status: nil) ⇒ Span
constructor
private
rubocop:disable Metrics/ParameterLists.
- #inspect ⇒ Object private
- #running? ⇒ Boolean private
- #start ⇒ Object private
Constructor Details
#initialize(transaction, id, name, type = nil, parent_id: nil, context: nil, http_status: nil) ⇒ Span
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.
rubocop:disable Metrics/ParameterLists
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/stackify_apm/span.rb', line 15 def initialize( transaction, id, name, type = nil, parent_id: nil, context: nil, http_status: nil ) @transaction = transaction @id = id @name = name @type = type || DEFAULT_TYPE @parent_id = parent_id @context = context @http_status = http_status @stacktrace = nil @original_backtrace = nil end |
Instance Attribute Details
#context ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def context @context end |
#duration ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def duration @duration end |
#http_status ⇒ 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.
rubocop:enable Metrics/ParameterLists
36 37 38 |
# File 'lib/stackify_apm/span.rb', line 36 def http_status @http_status end |
#id ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def id @id end |
#name ⇒ 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.
rubocop:enable Metrics/ParameterLists
36 37 38 |
# File 'lib/stackify_apm/span.rb', line 36 def name @name end |
#original_backtrace ⇒ 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.
rubocop:enable Metrics/ParameterLists
36 37 38 |
# File 'lib/stackify_apm/span.rb', line 36 def original_backtrace @original_backtrace end |
#parent_id ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def parent_id @parent_id end |
#relative_end ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def relative_end @relative_end end |
#relative_start ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def relative_start @relative_start end |
#stacktrace ⇒ 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.
37 38 39 |
# File 'lib/stackify_apm/span.rb', line 37 def stacktrace @stacktrace end |
#type ⇒ 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.
rubocop:enable Metrics/ParameterLists
36 37 38 |
# File 'lib/stackify_apm/span.rb', line 36 def type @type end |
Instance Method Details
#done ⇒ 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.
45 46 47 48 49 50 51 |
# File 'lib/stackify_apm/span.rb', line 45 def done @relative_end = Time.now.to_f * 1000 @duration = Time.now.to_f * 1000 self.original_backtrace = nil # release it self end |
#done? ⇒ Boolean
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.
53 54 55 56 |
# File 'lib/stackify_apm/span.rb', line 53 def done? # !!duration !duration.nil? end |
#inspect ⇒ 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.
62 63 64 65 66 67 |
# File 'lib/stackify_apm/span.rb', line 62 def inspect "<StackifyRubyAPM::Span id:#{id}" \ " name:#{name.inspect}" \ " type:#{type.inspect}" \ '>' end |
#running? ⇒ Boolean
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.
58 59 60 |
# File 'lib/stackify_apm/span.rb', line 58 def running? relative_start && !done? end |
#start ⇒ 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 40 41 42 43 |
# File 'lib/stackify_apm/span.rb', line 39 def start @relative_start = Time.now.to_f * 1000 self end |