Class: Sentry::Transaction::SpanRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry/transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_length) ⇒ SpanRecorder

Returns a new instance of SpanRecorder.

[View source]

355
356
357
358
# File 'lib/sentry/transaction.rb', line 355

def initialize(max_length)
  @max_length = max_length
  @spans = []
end

Instance Attribute Details

#max_lengthObject (readonly)

Returns the value of attribute max_length.


353
354
355
# File 'lib/sentry/transaction.rb', line 353

def max_length
  @max_length
end

#spansObject (readonly)

Returns the value of attribute spans.


353
354
355
# File 'lib/sentry/transaction.rb', line 353

def spans
  @spans
end

Instance Method Details

#add(span) ⇒ Object

[View source]

360
361
362
363
364
# File 'lib/sentry/transaction.rb', line 360

def add(span)
  if @spans.count < @max_length
    @spans << span
  end
end