Class: Mongo::Monitoring::Event::Cmap::PoolCreated

Inherits:
Base show all
Defined in:
build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_created.rb

Overview

Event published when a connection pool is created.

Since:

  • 2.9.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, options, pool) ⇒ PoolCreated

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.

PoolCreated.new(address, options, pool)

Since:

  • 2.9.0



53
54
55
56
57
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_created.rb', line 53

def initialize(address, options, pool)
  @address = address
  @options = options.dup.freeze
  @pool = pool
end

Instance Attribute Details

#addressMongo::Address (readonly)

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

Returns:

  • (Mongo::Address)

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

Since:

  • 2.9.0



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

def address
  @address
end

#optionsHash (readonly)

Returns options Options specified for pool creation.

Returns:

  • (Hash)

    options Options specified for pool creation.

Since:

  • 2.9.0



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

def options
  @options
end

#poolMongo::Server::ConnectionPool (readonly)

created.

Returns:

Since:

  • 2.11.0



44
45
46
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_created.rb', line 44

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



67
68
69
70
# File 'build/ruby-driver-v2.19/lib/mongo/monitoring/event/cmap/pool_created.rb', line 67

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