The class defines behavior for the performance monitoring API.
@since 2.1.0
| COMMAND | = | 'Command'.freeze |
The command topic.
@since 2.1.0 |
|
| SERVER_CLOSED | = | 'ServerClosed'.freeze |
Server closed topic.
@since 2.4.0 |
|
| SERVER_DESCRIPTION_CHANGED | = | 'ServerDescriptionChanged'.freeze |
Server description changed topic.
@since 2.4.0 |
|
| SERVER_OPENING | = | 'ServerOpening'.freeze |
Server opening topic.
@since 2.4.0 |
|
| TOPOLOGY_CHANGED | = | 'TopologyChanged'.freeze |
Topology changed topic.
@since 2.4.0 |
|
| TOPOLOGY_CLOSED | = | 'TopologyClosed'.freeze |
Topology closed topic.
@since 2.4.0 |
|
| TOPOLOGY_OPENING | = | 'TopologyOpening'.freeze |
Topology opening topic.
@since 2.4.0 |
|
| SERVER_HEARTBEAT | = | 'ServerHeartbeat'.freeze |
Server heartbeat started topic.
@since 2.7.0 |
| options | [R] | @api private |
Initialize the monitoring.
@example Create the new monitoring.
Monitoring.new(:monitoring => true)
@param [ Hash ] options Options. Client constructor forwards its
options to Monitoring constructor, although Monitoring recognizes only a subset of the options recognized by Client.
@option options [ true, false ] :monitoring If false is given, the
Monitoring instance is initialized without global monitoring event subscribers and will not publish SDAM events. Command monitoring events will still be published, and the driver will still perform SDAM and monitor its cluster in order to perform server selection. Built-in driver logging of SDAM events will be disabled because it is implemented through SDAM event subscription. Client#subscribe will succeed for all event types, but subscribers to SDAM events will not be invoked. Values other than false result in default behavior which is to perform normal SDAM event publication.
@since 2.1.0 @api private
Used for generating unique operation ids to link events together.
@example Get the next operation id.
Monitoring.next_operation_id
@return [ Integer ] The next operation id.
@since 2.1.0