Class: Mongo::Monitoring::Event::Cmap::ConnectionClosed
- Inherits:
-
Base
- Object
- Event::Base
- Base
- Mongo::Monitoring::Event::Cmap::ConnectionClosed
- Defined in:
- lib/mongo/monitoring/event/cmap/connection_closed.rb
Overview
Event published when a connection is closed.
Constant Summary collapse
- STALE =
Returns STALE Indicates that the connection was closed due to it being stale.
:stale
- IDLE =
Returns IDLE Indicates that the connection was closed due to it being idle.
:idle
- ERROR =
Returns ERROR Indicates that the connection was closed due to it experiencing an error.
:error
- POOL_CLOSED =
Returns POOL_CLOSED Indicates that the connection was closed due to the pool already being closed.
:pool_closed
- HANDSHAKE_FAILED =
Returns HANDSHAKE_FAILED Indicates that the connection was closed due to the connection handshake failing.
:handshake_failed
- UNKNOWN =
Returns UNKNOWN Indicates that the connection was closed for an unknown reason.
:unknown
Instance Attribute Summary collapse
-
#address ⇒ Mongo::Address
readonly
Address The address of the server the pool’s connections will connect to.
-
#connection_id ⇒ Integer
readonly
Connection_id The ID of the connection.
-
#reason ⇒ Symbol
readonly
Reason The reason why the connection was closed.
Instance Method Summary collapse
-
#initialize(address, id, reason) ⇒ ConnectionClosed
constructor
private
Create the event.
-
#summary ⇒ String
Returns a concise yet useful summary of the event.
Constructor Details
#initialize(address, id, reason) ⇒ ConnectionClosed
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.
84 85 86 87 88 |
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 84 def initialize(address, id, reason) @reason = reason @address = address @connection_id = id end |
Instance Attribute Details
#address ⇒ Mongo::Address (readonly)
Returns address The address of the server the pool’s connections will connect to.
75 76 77 |
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 75 def address @address end |
#connection_id ⇒ Integer (readonly)
Returns connection_id The ID of the connection.
64 65 66 |
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 64 def connection_id @connection_id end |
#reason ⇒ Symbol (readonly)
Returns reason The reason why the connection was closed.
69 70 71 |
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 69 def reason @reason end |
Instance Method Details
#summary ⇒ String
This method is experimental and subject to change.
Returns a concise yet useful summary of the event.
98 99 100 101 |
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 98 def summary "#<#{self.class.name.sub(/^Mongo::Monitoring::Event::Cmap::/, '')} " + "address=#{address} connection_id=#{connection_id} reason=#{reason}>" end |