Class: Datadog::Core::Telemetry::Event::MessageBatch

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/telemetry/event.rb

Overview

Telemetry class for the ‘message-batch’ event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(events) ⇒ MessageBatch

Returns a new instance of MessageBatch.



386
387
388
# File 'lib/datadog/core/telemetry/event.rb', line 386

def initialize(events)
  @events = events
end

Instance Attribute Details

#eventsObject (readonly)

Returns the value of attribute events.



380
381
382
# File 'lib/datadog/core/telemetry/event.rb', line 380

def events
  @events
end

Instance Method Details

#payloadObject



390
391
392
393
394
395
396
397
# File 'lib/datadog/core/telemetry/event.rb', line 390

def payload
  @events.map do |event|
    {
      request_type: event.type,
      payload: event.payload,
    }
  end
end

#typeObject



382
383
384
# File 'lib/datadog/core/telemetry/event.rb', line 382

def type
  'message-batch'
end