Class: Datadog::Core::Telemetry::Event::MessageBatch
- Inherits:
-
Object
- Object
- Datadog::Core::Telemetry::Event::MessageBatch
- Defined in:
- lib/datadog/core/telemetry/event.rb
Overview
Telemetry class for the ‘message-batch’ event
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(events) ⇒ MessageBatch
constructor
A new instance of MessageBatch.
- #payload ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(events) ⇒ MessageBatch
Returns a new instance of MessageBatch.
460 461 462 |
# File 'lib/datadog/core/telemetry/event.rb', line 460 def initialize(events) @events = events end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
454 455 456 |
# File 'lib/datadog/core/telemetry/event.rb', line 454 def events @events end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
473 474 475 |
# File 'lib/datadog/core/telemetry/event.rb', line 473 def ==(other) other.is_a?(MessageBatch) && other.events == @events end |
#hash ⇒ Object
479 480 481 |
# File 'lib/datadog/core/telemetry/event.rb', line 479 def hash [self.class, @events].hash end |
#payload ⇒ Object
464 465 466 467 468 469 470 471 |
# File 'lib/datadog/core/telemetry/event.rb', line 464 def payload @events.map do |event| { request_type: event.type, payload: event.payload, } end end |
#type ⇒ Object
456 457 458 |
# File 'lib/datadog/core/telemetry/event.rb', line 456 def type 'message-batch' end |