Class: Mongo::Monitoring::Event::Cmap::ConnectionCheckOutFailed

Inherits:
Base
  • Object
show all
Defined in:
lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb

Overview

Event published when a connection is unable to be checked out of a pool.

Since:

  • 2.9.0

Constant Summary collapse

POOL_CLOSED =

Returns POOL_CLOSED Indicates that the connection check out failed due to the pool already being closed.

Returns:

  • (Symbol)

    POOL_CLOSED Indicates that the connection check out failed due to the pool already being closed.

Since:

  • 2.9.0

:pool_closed
TIMEOUT =

Returns TIMEOUT Indicates that the connection check out failed due to the timeout being reached before a connection became available.

Returns:

  • (Symbol)

    TIMEOUT Indicates that the connection check out failed due to the timeout being reached before a connection became available.

Since:

  • 2.9.0

:timeout
CONNECTION_ERROR =

Returns CONNECTION_ERROR Indicates that the connection check out failed due to an error encountered while setting up a new connection.

Returns:

  • (Symbol)

    CONNECTION_ERROR Indicates that the connection check out failed due to an error encountered while setting up a new connection.

Since:

  • 2.10.0

:connection_error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, reason) ⇒ ConnectionCheckOutFailed

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.

Parameters:

Since:

  • 2.9.0



67
68
69
70
# File 'lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb', line 67

def initialize(address, reason)
  @reason = reason
  @address = address
end

Instance Attribute Details

#addressMongo::Address (readonly)

Returns address The address of the server the connection would have connected to.

Returns:

  • (Mongo::Address)

    address The address of the server the connection would have connected to.

Since:

  • 2.9.0



52
53
54
# File 'lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb', line 52

def address
  @address
end

#reasonSymbol (readonly)

Returns reason The reason a connection was unable to be acquired.

Returns:

  • (Symbol)

    reason The reason a connection was unable to be acquired.

Since:

  • 2.9.0



58
59
60
# File 'lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb', line 58

def reason
  @reason
end

Instance Method Details

#summaryString

Note:

This method is experimental and subject to change.

Returns a concise yet useful summary of the event.

Returns:

  • (String)

    String summary of the event.

Since:

  • 2.9.0



80
81
82
83
# File 'lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb', line 80

def summary
  "#<#{self.class.name.sub(/^Mongo::Monitoring::Event::Cmap::/, '')} address=#{address} " +
      "reason=#{reason}>"
end