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.
25 26 27 |
# File 'lib/mongo/monitoring/publishable.rb', line 25 def monitoring @monitoring end |
Instance Method Details
#publish_cmap_event(event) ⇒ Object
39 40 41 42 43 |
# File 'lib/mongo/monitoring/publishable.rb', line 39 def publish_cmap_event(event) return unless monitoring? monitoring.published(Monitoring::CONNECTION_POOL, event) end |
#publish_event(topic, event) ⇒ Object
Deprecated.
28 29 30 |
# File 'lib/mongo/monitoring/publishable.rb', line 28 def publish_event(topic, event) monitoring.succeeded(topic, event) end |
#publish_sdam_event(topic, event) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/mongo/monitoring/publishable.rb', line 32 def publish_sdam_event(topic, event) return unless monitoring? #log_debug("EVENT: #{event.summary}") monitoring.succeeded(topic, event) end |