Class: Datadog::Core::Telemetry::Event::MessageBatch Private
- 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
- #events ⇒ Object readonly private
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?) private
- #hash ⇒ Object private
-
#initialize(events) ⇒ MessageBatch
constructor
private
A new instance of MessageBatch.
- #payload ⇒ Object private
- #type ⇒ Object private
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
#events ⇒ Object (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 |
#hash ⇒ Object
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 |
#payload ⇒ Object
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 |
#type ⇒ Object
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 |