Class: Appdash::Span
- Inherits:
-
Object
- Object
- Appdash::Span
- Defined in:
- lib/appdash/span.rb,
lib/appdash/span/id.rb
Defined Under Namespace
Classes: ID
Instance Attribute Summary collapse
- #id ⇒ Object readonly
- #root_id ⇒ Object readonly
Instance Method Summary collapse
-
#event(evt) ⇒ Object
Appends a generic Appdash::Event event.
- #flush ⇒ Object
-
#initialize(client) ⇒ Span
constructor
A new instance of Span.
-
#log(msg) ⇒ Object
Appends a new Appdash::Event::Log event.
-
#message(msg) ⇒ Object
Appends a new Appdash::Event::Message event.
-
#name(val) ⇒ Object
Appends a new Appdash::Event::SpanName event.
Constructor Details
Instance Attribute Details
#id ⇒ Object (readonly)
10 11 12 |
# File 'lib/appdash/span.rb', line 10 def id @id end |
#root_id ⇒ Object (readonly)
7 8 9 |
# File 'lib/appdash/span.rb', line 7 def root_id @root_id end |
Instance Method Details
#event(evt) ⇒ Object
Appends a generic Appdash::Event event
35 36 37 38 |
# File 'lib/appdash/span.rb', line 35 def event(evt) @packets.push Appdash::CollectPacket.build(evt, @id) @id = @id.child end |
#flush ⇒ Object
40 41 42 43 44 45 |
# File 'lib/appdash/span.rb', line 40 def flush count = @packets.size @client.send :write, @packets @packets.clear count end |
#log(msg) ⇒ Object
Appends a new Appdash::Event::Log event
30 31 32 |
# File 'lib/appdash/span.rb', line 30 def log(msg) event Appdash::Event::Log.new(msg) end |