Class: Traces::Backend::Console::Span

Inherits:
Object
  • Object
show all
Defined in:
lib/traces/backend/console.rb

Overview

A span which validates tag assignment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, name) ⇒ Span

Initialize a new span.



22
23
24
25
# File 'lib/traces/backend/console.rb', line 22

def initialize(context, name)
	@context = context
	@name = name
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



28
29
30
# File 'lib/traces/backend/console.rb', line 28

def context
  @context
end

Instance Method Details

#[]=(key, value) ⇒ Object

Assign some metadata to the span.



33
34
35
# File 'lib/traces/backend/console.rb', line 33

def []= key, value
	::Console.logger.info(@context, @name, "#{key} = #{value}")
end

#The context in which the span is recorded.=(context) ⇒ Object



28
# File 'lib/traces/backend/console.rb', line 28

attr :context