Module: Mongo::Monitoring::Publishable
- Includes:
- Loggable
- Included in:
- Cluster, Cluster::Topology::Base, Server, Server::Connection, Server::ConnectionBase, Server::ConnectionPool
- Defined in:
- lib/mongo/monitoring/publishable.rb
Overview
Defines behavior for an object that can publish monitoring events.
Constant Summary
Constants included from Loggable
Instance Attribute Summary collapse
-
#monitoring ⇒ Monitoring
readonly
Monitoring The monitoring.
Instance Method Summary collapse
- #publish_cmap_event(event) ⇒ Object
- #publish_event(topic, event) ⇒ Object deprecated Deprecated.
- #publish_sdam_event(topic, event) ⇒ Object
Methods included from Loggable
#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger
Instance Attribute Details
#monitoring ⇒ Monitoring (readonly)
Returns monitoring The monitoring.
28 29 30 |
# File 'lib/mongo/monitoring/publishable.rb', line 28 def monitoring @monitoring end |
Instance Method Details
#publish_cmap_event(event) ⇒ Object
41 42 43 44 45 |
# File 'lib/mongo/monitoring/publishable.rb', line 41 def publish_cmap_event(event) return unless monitoring? monitoring.published(Monitoring::CONNECTION_POOL, event) end |
#publish_event(topic, event) ⇒ Object
Deprecated.
31 32 33 |
# File 'lib/mongo/monitoring/publishable.rb', line 31 def publish_event(topic, event) monitoring.succeeded(topic, event) end |
#publish_sdam_event(topic, event) ⇒ Object
35 36 37 38 39 |
# File 'lib/mongo/monitoring/publishable.rb', line 35 def publish_sdam_event(topic, event) return unless monitoring? monitoring.succeeded(topic, event) end |