Class: Mongo::Monitoring::Event::CommandStarted
- Inherits:
-
Event::Base
- Object
- Event::Base
- Mongo::Monitoring::Event::CommandStarted
- Includes:
- Secure
- Defined in:
- lib/mongo/monitoring/event/command_started.rb
Overview
Event that is fired when a command operation starts.
Constant Summary
Constants included from Secure
Instance Attribute Summary collapse
-
#address ⇒ Server::Address
readonly
Address The server address.
-
#command ⇒ BSON::Document
readonly
Command The command arguments.
-
#command_name ⇒ String
readonly
Command_name The name of the command.
-
#database_name ⇒ String
readonly
Database_name The name of the database_name.
-
#operation_id ⇒ Integer
readonly
Operation_id The operation id.
-
#request_id ⇒ Integer
readonly
Request_id The request id.
Class Method Summary collapse
-
.generate(address, operation_id, payload) ⇒ CommandStarted
private
Create the event from a wire protocol message payload.
Instance Method Summary collapse
-
#initialize(command_name, database_name, address, request_id, operation_id, command) ⇒ CommandStarted
constructor
private
Create the new event.
-
#inspect ⇒ String
Returns a concise yet useful summary of the event.
Methods included from Secure
#compression_allowed?, #redacted
Constructor Details
#initialize(command_name, database_name, address, request_id, operation_id, command) ⇒ CommandStarted
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.
56 57 58 59 60 61 62 63 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 56 def initialize(command_name, database_name, address, request_id, operation_id, command) @command_name = command_name.to_s @database_name = database_name @address = address @request_id = request_id @operation_id = operation_id @command = redacted(command_name, command) end |
Instance Attribute Details
#address ⇒ Server::Address (readonly)
Returns address The server address.
26 27 28 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 26 def address @address end |
#command ⇒ BSON::Document (readonly)
Returns command The command arguments.
29 30 31 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 29 def command @command end |
#command_name ⇒ String (readonly)
Returns command_name The name of the command.
32 33 34 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 32 def command_name @command_name end |
#database_name ⇒ String (readonly)
Returns database_name The name of the database_name.
35 36 37 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 35 def database_name @database_name end |
#operation_id ⇒ Integer (readonly)
Returns operation_id The operation id.
38 39 40 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 38 def operation_id @operation_id end |
#request_id ⇒ Integer (readonly)
Returns request_id The request id.
41 42 43 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 41 def request_id @request_id end |
Class Method Details
.generate(address, operation_id, payload) ⇒ CommandStarted
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.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 78 def self.generate(address, operation_id, payload) new( payload[:command_name], payload[:database_name], address, payload[:request_id], operation_id, payload[:command] ) end |
Instance Method Details
#inspect ⇒ String
Returns a concise yet useful summary of the event.
94 95 96 |
# File 'lib/mongo/monitoring/event/command_started.rb', line 94 def inspect "#<{#{self.class} command=#{command_name}>" end |