ConnectionClosed — Documentation by YARD 0.9.37 (original) (raw)

Class: Mongo::Monitoring::Event::Cmap::ConnectionClosed

Inherits:

Base

Defined in:

lib/mongo/monitoring/event/cmap/connection_closed.rb

Overview

Event published when a connection is closed.

Constant Summarycollapse

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

Instance Method Summarycollapse

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

#addressMongo::Address

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

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

#reasonSymbol

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

Note:

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