Module: Mongo::Monitoring::Publishable
- Includes:
- Loggable
- Included in:
- Cluster, Cluster::Topology::Base, Server, Server::Connection
- 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
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_event(topic, event) ⇒ Object
27 28 29 |
# File 'lib/mongo/monitoring/publishable.rb', line 27 def publish_event(topic, event) monitoring.succeeded(topic, event) end |
#publish_sdam_event(topic, event) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/mongo/monitoring/publishable.rb', line 31 def publish_sdam_event(topic, event) return unless monitoring? log_debug("EVENT: #{event.summary}") monitoring.succeeded(topic, event) end |