Class: Mongo::Monitoring::Event::Cmap::PoolCleared

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

Overview

Event published when a connection pool is cleared.

Since:

  • 2.9.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, service_id: nil) ⇒ PoolCleared

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:

  • address (Address)
  • service_id (Object) (defaults to: nil)

    The service id, if any.

Since:

  • 2.9.0



43
44
45
46
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/pool_cleared.rb', line 43

def initialize(address, service_id: nil)
  @address = address
  @service_id = service_id
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-master/lib/mongo/monitoring/event/cmap/pool_cleared.rb', line 32

def address
  @address
end

#service_idnil | Object (readonly)

Returns The service id, if any.

Returns:

  • (nil | Object)

    The service id, if any.

Since:

  • 2.9.0



35
36
37
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/pool_cleared.rb', line 35

def service_id
  @service_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



56
57
58
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/cmap/pool_cleared.rb', line 56

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