Class: Mongo::Monitoring::Event::Cmap::ConnectionCheckedIn

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

Overview

Event published when a connection is returned to a connection pool.

Since:

  • 2.9.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, id, pool) ⇒ ConnectionCheckedIn

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.

Examples:

Create the event.

ConnectionCheckedIn.new(address, id, pool)

Since:

  • 2.9.0



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

def initialize(address, id, pool)
  @address = address
  @connection_id = id
  @pool = pool
end

Instance Attribute Details

#addressAddress (readonly)

Returns address The address of the server the connection was connected to.

Returns:

  • (Address)

    address The address of the server the connection was connected to.

Since:

  • 2.9.0



31
32
33
# File 'lib/mongo/monitoring/event/cmap/connection_checked_in.rb', line 31

def address
  @address
end

#connection_idInteger (readonly)

Returns connection_id The ID of the connection.

Returns:

  • (Integer)

    connection_id The ID of the connection.

Since:

  • 2.9.0



36
37
38
# File 'lib/mongo/monitoring/event/cmap/connection_checked_in.rb', line 36

def connection_id
  @connection_id
end

#poolMongo::Server::ConnectionPool (readonly)

was checked in to.

Returns:

Since:

  • 2.11.0



43
44
45
# File 'lib/mongo/monitoring/event/cmap/connection_checked_in.rb', line 43

def pool
  @pool
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



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

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