类:Mongo::Monitoring::Event::Cmap::PoolCreated

继承:
Base 显示全部
定义于:
lib/ Mongo/ 监控/ 事件/cmap/pool_created.rb

Overview

创建连接池时发布的事件。

由于:

  • 2.9.0

实例属性摘要折叠

实例方法摘要折叠

构造函数详情

#初始化(地址, 选项, 池) ="PoolCreated"

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

创建事件。

例子:

创建事件。

PoolCreated.new(address, options, pool)

由于:

  • 2.9.0



50
51
52
53
54
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_created.rb', line 50

def 初始化(地址, 选项, )
  @address = 地址
  @options = 选项.dup.冻结
  @pool = 
end

实例属性详细信息

#地址Mongo::Address (readonly)

返回解决池的连接将连接到的服务器的解决。

返回:

  • ( Mongo::Address )

    解决池的连接将连接到的服务器的解决。

由于:

  • 2.9.0



29
30
31
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_created.rb', line 29

def 地址
  @address
end

# options哈希(只读)

返回为创建池指定的选项。

返回:

  • (哈希)

    options 为创建池指定的选项。

由于:

  • 2.9.0



34
35
36
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_created.rb', line 34

def 选项
  @options
end

#Mongo::Server::ConnectionPool (只读)

创建。

返回:

由于:

  • 2.11.0



41
42
43
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_created.rb', line 41

def 
  @pool
end

实例方法详细信息

#摘要string

注意:

此方法是实验性的,可能会发生变化。

返回简洁而有用的事件摘要。

返回:

  • ( string )

    事件摘要的string 。

由于:

  • 2.9.0



64
65
66
67
# File 'lib/ Mongo/ 监控/ 事件/cmap/pool_created.rb', line 64

def 总结
  " #< #{ { self . class . name . sub ( / ^Mongo::Monitoring::Event::Cmap:: / , ' ' ) } " +
    "地址= #{地址}选项= #{选项}池= 0 x #{。object_id } } > "
end