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

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Telemetry class for the ‘message-batch’ event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(events) ⇒ MessageBatch

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MessageBatch.



15
16
17
18
# File 'lib/datadog/core/telemetry/event/message_batch.rb', line 15

def initialize(events)
  super()
  @events = events
end

Instance Attribute Details

#eventsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/datadog/core/telemetry/event/message_batch.rb', line 9

def events
  @events
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/datadog/core/telemetry/event/message_batch.rb', line 29

def ==(other)
  other.is_a?(MessageBatch) && other.events == @events
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
# File 'lib/datadog/core/telemetry/event/message_batch.rb', line 35

def hash
  [self.class, @events].hash
end

#payloadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
23
24
25
26
27
# File 'lib/datadog/core/telemetry/event/message_batch.rb', line 20

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

#typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/datadog/core/telemetry/event/message_batch.rb', line 11

def type
  'message-batch'
end