Class: Instana::Span
- Inherits:
-
Object
- Object
- Instana::Span
- Defined in:
- lib/instana/tracing/span.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #custom? ⇒ Boolean
- #duration ⇒ Object
- #id ⇒ Object
-
#initialize(data) ⇒ Span
constructor
A new instance of Span.
- #is_root? ⇒ Boolean
- #key?(k) ⇒ Boolean
- #name ⇒ Object
- #parent_id ⇒ Object
- #raw ⇒ Object
Constructor Details
#initialize(data) ⇒ Span
Returns a new instance of Span.
5 6 7 |
# File 'lib/instana/tracing/span.rb', line 5 def initialize(data) @data = data end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
3 4 5 |
# File 'lib/instana/tracing/span.rb', line 3 def parent @parent end |
Instance Method Details
#[](key) ⇒ Object
33 34 35 |
# File 'lib/instana/tracing/span.rb', line 33 def [](key) @data[key.to_sym] end |
#[]=(key, value) ⇒ Object
37 38 39 |
# File 'lib/instana/tracing/span.rb', line 37 def []=(key, value) @data[key.to_sym] = value end |
#custom? ⇒ Boolean
49 50 51 |
# File 'lib/instana/tracing/span.rb', line 49 def custom? @data[:n] == :sdk end |
#duration ⇒ Object
25 26 27 |
# File 'lib/instana/tracing/span.rb', line 25 def duration @data[:d] end |
#id ⇒ Object
9 10 11 |
# File 'lib/instana/tracing/span.rb', line 9 def id @data[:s] end |
#is_root? ⇒ Boolean
29 30 31 |
# File 'lib/instana/tracing/span.rb', line 29 def is_root? @data[:s] == @data[:t] end |
#key?(k) ⇒ Boolean
41 42 43 |
# File 'lib/instana/tracing/span.rb', line 41 def key?(k) @data.key?(k.to_sym) end |
#name ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/instana/tracing/span.rb', line 17 def name if custom? @data[:data][:sdk][:name] else @data[:n] end end |
#parent_id ⇒ Object
13 14 15 |
# File 'lib/instana/tracing/span.rb', line 13 def parent_id @data[:p] end |
#raw ⇒ Object
45 46 47 |
# File 'lib/instana/tracing/span.rb', line 45 def raw @data end |