Class: Mongo::Monitoring::Event::CommandSucceeded
- Inherits:
-
Object
- Object
- Mongo::Monitoring::Event::CommandSucceeded
- Includes:
- Secure
- Defined in:
- lib/mongo/monitoring/event/command_succeeded.rb
Overview
Event that is fired when a command operation succeeds.
Constant Summary
Constants included from Secure
Instance Attribute Summary collapse
-
#address ⇒ Server::Address
readonly
Address The server address.
-
#command_name ⇒ String
readonly
Command_name The name of the command.
-
#database_name ⇒ String
readonly
Database_name The name of the database.
-
#duration ⇒ Float
readonly
Duration The duration of the event.
-
#operation_id ⇒ Integer
readonly
Operation_id The operation id.
-
#reply ⇒ BSON::Document
readonly
Reply The command reply.
-
#request_id ⇒ Integer
readonly
Request_id The request id.
Class Method Summary collapse
-
.generate(address, operation_id, command_payload, reply_payload, duration) ⇒ CommandCompleted
Create the event from a wire protocol message payload.
Instance Method Summary collapse
-
#initialize(command_name, database_name, address, request_id, operation_id, reply, duration) ⇒ CommandSucceeded
constructor
Create the new event.
Methods included from Secure
Constructor Details
#initialize(command_name, database_name, address, request_id, operation_id, reply, duration) ⇒ CommandSucceeded
Create the new event.
59 60 61 62 63 64 65 66 67 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 59 def initialize(command_name, database_name, address, request_id, operation_id, reply, duration) @command_name = command_name @database_name = database_name @address = address @request_id = request_id @operation_id = operation_id @reply = redacted(command_name, reply) @duration = duration end |
Instance Attribute Details
#address ⇒ Server::Address (readonly)
Returns address The server address.
26 27 28 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 26 def address @address end |
#command_name ⇒ String (readonly)
Returns command_name The name of the command.
29 30 31 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 29 def command_name @command_name end |
#database_name ⇒ String (readonly)
Returns database_name The name of the database.
35 36 37 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 35 def database_name @database_name end |
#duration ⇒ Float (readonly)
Returns duration The duration of the event.
38 39 40 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 38 def duration @duration end |
#operation_id ⇒ Integer (readonly)
Returns operation_id The operation id.
41 42 43 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 41 def operation_id @operation_id end |
#reply ⇒ BSON::Document (readonly)
Returns reply The command reply.
32 33 34 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 32 def reply @reply end |
#request_id ⇒ Integer (readonly)
Returns request_id The request id.
44 45 46 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 44 def request_id @request_id end |
Class Method Details
.generate(address, operation_id, command_payload, reply_payload, duration) ⇒ CommandCompleted
Create the event from a wire protocol message payload.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/mongo/monitoring/event/command_succeeded.rb', line 83 def self.generate(address, operation_id, command_payload, reply_payload, duration) new( command_payload[:command_name], command_payload[:database_name], address, command_payload[:request_id], operation_id, generate_reply(command_payload, reply_payload), duration ) end |