Class Mongo::Monitoring
In: lib/mongo/monitoring.rb
lib/mongo/monitoring/server_closed_log_subscriber.rb
lib/mongo/monitoring/topology_closed_log_subscriber.rb
lib/mongo/monitoring/topology_opening_log_subscriber.rb
lib/mongo/monitoring/topology_changed_log_subscriber.rb
lib/mongo/monitoring/sdam_log_subscriber.rb
lib/mongo/monitoring/server_description_changed_log_subscriber.rb
lib/mongo/monitoring/event/server_opening.rb
lib/mongo/monitoring/event/topology_opening.rb
lib/mongo/monitoring/event/command_failed.rb
lib/mongo/monitoring/event/server_heartbeat_failed.rb
lib/mongo/monitoring/event/command_started.rb
lib/mongo/monitoring/event/server_description_changed.rb
lib/mongo/monitoring/event/server_heartbeat_started.rb
lib/mongo/monitoring/event/command_succeeded.rb
lib/mongo/monitoring/event/server_closed.rb
lib/mongo/monitoring/event/topology_closed.rb
lib/mongo/monitoring/event/topology_changed.rb
lib/mongo/monitoring/event/server_heartbeat_succeeded.rb
lib/mongo/monitoring/event/secure.rb
lib/mongo/monitoring/server_opening_log_subscriber.rb
lib/mongo/monitoring/publishable.rb
lib/mongo/monitoring/command_log_subscriber.rb
Parent: Object

The class defines behavior for the performance monitoring API.

@since 2.1.0

Methods

Included Modules

Id Subscribable

Classes and Modules

Module Mongo::Monitoring::Event
Module Mongo::Monitoring::Global
Module Mongo::Monitoring::Publishable
Module Mongo::Monitoring::Subscribable
Class Mongo::Monitoring::CommandLogSubscriber
Class Mongo::Monitoring::SDAMLogSubscriber
Class Mongo::Monitoring::ServerClosedLogSubscriber
Class Mongo::Monitoring::ServerDescriptionChangedLogSubscriber
Class Mongo::Monitoring::ServerOpeningLogSubscriber
Class Mongo::Monitoring::TopologyChangedLogSubscriber
Class Mongo::Monitoring::TopologyClosedLogSubscriber
Class Mongo::Monitoring::TopologyOpeningLogSubscriber

Constants

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

Attributes

options  [R]  @api private

Public Class methods

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

Public Instance methods

Publish a failed event.

@example Publish a failed event.

  monitoring.failed(COMMAND, event)

@param [ String ] topic The event topic. @param [ Event ] event The event to publish.

@since 2.1.0

@api private

Publish a started event.

@example Publish a started event.

  monitoring.started(COMMAND, event)

@param [ String ] topic The event topic. @param [ Event ] event The event to publish.

@since 2.1.0

Publish a succeeded event.

@example Publish a succeeded event.

  monitoring.succeeded(COMMAND, event)

@param [ String ] topic The event topic. @param [ Event ] event The event to publish.

@since 2.1.0

[Validate]