Method: Mongo::Monitoring::Event::CommandSucceeded#initialize

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

#initialize(command_name, database_name, address, request_id, operation_id, reply, duration, started_event:, server_connection_id: nil, service_id: nil) ⇒ CommandSucceeded

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 new event.

Examples:

Create the event.

Parameters:

  • command_name (String)

    The name of the command.

  • database_name (String)

    The database name.

  • address (Server::Address)

    The server address.

  • request_id (Integer)

    The request id.

  • operation_id (Integer)

    The operation id.

  • reply (BSON::Document)

    The command reply.

  • duration (Float)

    The duration the command took in seconds.

  • started_event (Monitoring::Event::CommandStarted)

    The corresponding started event.

  • service_id (Object) (defaults to: nil)

    The service id, if any.

Since:

  • 2.1.0



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 78

def initialize(command_name, database_name, address, request_id,
  operation_id, reply, duration, started_event:,
  server_connection_id: nil, service_id: nil
)
  @command_name = command_name.to_s
  @database_name = database_name
  @address = address
  @request_id = request_id
  @operation_id = operation_id
  @service_id = service_id
  @started_event = started_event
  @reply = redacted(command_name, reply)
  @duration = duration
  @server_connection_id = server_connection_id
end