Class: Mongo::Monitoring::Event::Cmap::ConnectionCreated

Inherits:
Base
  • Object
show all
Defined in:
build/ruby-driver-master/lib/mongo/monitoring/event/cmap/connection_created.rb

Overview

Event published when a connection is created.

Since:

  • 2.9.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, id) ⇒ ConnectionCreated

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.

ConnectionCreated.new(address, id)

Since:

  • 2.9.0



46
47
48
49
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/connection_created.rb', line 46

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

Instance Attribute Details

#addressMongo::Address (readonly)

Returns address The address of the server the connection will connect to.

Returns:

  • (Mongo::Address)

    address The address of the server the connection will connect to.

Since:

  • 2.9.0



32
33
34
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/connection_created.rb', line 32

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



37
38
39
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/connection_created.rb', line 37

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



59
60
61
62
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/connection_created.rb', line 59

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