123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongo::Monitoring::Event::Cmap::Base
Defined in: lib/mongo/monitoring/event/cmap/connection_closed.rb

Overview

::Mongo::Monitoring::Event published when a connection is closed.

Since:

  • 2.9.0

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Mongo::Event::Base - Inherited

#summary

Returns a concise yet useful summary of the event.

#short_class_name

Constructor Details

.new(address, id, reason) ⇒ ConnectionClosed

Create the event.

Examples:

Create the event.

ConnectionClosed.new(address, id, reason)

Since:

  • 2.9.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 81

def initialize(address, id, reason)
  super()
  @reason = reason
  @address = address
  @connection_id = id
end

Instance Attribute Details

#address ⇒ Mongo::Address (readonly)

Returns:

  • (Mongo::Address) —

    address The address of the server the pool's connections will connect to.

Since:

  • 2.9.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 72

attr_reader :address

#connection_id ⇒ Integer (readonly)

Returns:

  • (Integer) —

    connection_id The ID of the connection.

Since:

  • 2.9.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 61

attr_reader :connection_id

#reason ⇒ Symbol (readonly)

Returns:

  • (Symbol) —

    reason The reason why the connection was closed.

Since:

  • 2.9.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 66

attr_reader :reason

Instance Method Details

#summary ⇒ String

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

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/cmap/connection_closed.rb', line 96

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