Class: Mongo::Monitoring::Event::CommandFailed
- Inherits:
-
Object
- Object
- Mongo::Monitoring::Event::CommandFailed
- Defined in:
- lib/mongo/monitoring/event/command_failed.rb
Overview
Event that is fired when a command operation fails.
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_name.
-
#duration ⇒ Float
readonly
Duration The duration of the command in seconds.
-
#message ⇒ String
readonly
Message The error message.
-
#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, message, duration) ⇒ CommandFailed
Create the event from a wire protocol message payload.
Instance Method Summary collapse
-
#initialize(command_name, database_name, address, request_id, operation_id, message, duration) ⇒ CommandFailed
constructor
Create the new event.
Constructor Details
#initialize(command_name, database_name, address, request_id, operation_id, message, duration) ⇒ CommandFailed
Create the new event.
58 59 60 61 62 63 64 65 66 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 58 def initialize(command_name, database_name, address, request_id, operation_id, , duration) @command_name = command_name @database_name = database_name @address = address @request_id = request_id @operation_id = operation_id @message = @duration = duration end |
Instance Attribute Details
#address ⇒ Server::Address (readonly)
Returns address The server address.
25 26 27 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 25 def address @address end |
#command_name ⇒ String (readonly)
Returns command_name The name of the command.
28 29 30 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 28 def command_name @command_name end |
#database_name ⇒ String (readonly)
Returns database_name The name of the database_name.
31 32 33 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 31 def database_name @database_name end |
#duration ⇒ Float (readonly)
Returns duration The duration of the command in seconds.
34 35 36 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 34 def duration @duration end |
#message ⇒ String (readonly)
Returns message The error message.
37 38 39 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 37 def @message end |
#operation_id ⇒ Integer (readonly)
Returns operation_id The operation id.
40 41 42 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 40 def operation_id @operation_id end |
#request_id ⇒ Integer (readonly)
Returns request_id The request id.
43 44 45 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 43 def request_id @request_id end |
Class Method Details
.generate(address, operation_id, payload, message, duration) ⇒ CommandFailed
Create the event from a wire protocol message payload.
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/mongo/monitoring/event/command_failed.rb', line 82 def self.generate(address, operation_id, payload, , duration) new( payload[:command_name], payload[:database_name], address, payload[:request_id], operation_id, , duration ) end |