Method: Mongo::Monitoring::Event::CommandFailed.generate

Defined in:
lib/mongo/monitoring/event/command_failed.rb

.generate(address, operation_id, payload, message, failure, duration, started_event:, service_id: nil) ⇒ CommandFailed

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.

Create the event from a wire protocol message payload.

Examples:

Create the event.

CommandFailed.generate(address, 1, payload, duration)

Since:

  • 2.1.0



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/mongo/monitoring/event/command_failed.rb', line 128

def self.generate(address, operation_id, payload, message,
  failure, duration, started_event:, service_id: nil
)
  new(
    payload[:command_name],
    payload[:database_name],
    address,
    payload[:request_id],
    operation_id,
    message,
    failure,
    duration,
    started_event: started_event,
    service_id: service_id,
  )
end