Class: Attio::Observability::Traces::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/attio/observability.rb

Overview

In-memory tracing for testing

Since:

  • 1.0.0

Defined Under Namespace

Classes: Span

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMemory

Returns a new instance of Memory.

Since:

  • 1.0.0



359
360
361
# File 'lib/attio/observability.rb', line 359

def initialize
  @spans = []
end

Instance Attribute Details

#spansObject (readonly)

Since:

  • 1.0.0



357
358
359
# File 'lib/attio/observability.rb', line 357

def spans
  @spans
end

Instance Method Details

#reset!Object

Since:

  • 1.0.0



370
371
372
# File 'lib/attio/observability.rb', line 370

def reset!
  @spans.clear
end

#span(name) {|span| ... } ⇒ Object

Yields:

Since:

  • 1.0.0



363
364
365
366
367
368
# File 'lib/attio/observability.rb', line 363

def span(name)
  span = Span.new(name)
  @spans << span
  yield(span) if block_given?
  span
end