Class: Skylight::Probes::Mongo::Probe Private
- Defined in:
- lib/skylight/probes/mongo.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #install ⇒ Object private
Instance Method Details
#install ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/skylight/probes/mongo.rb', line 7 def install subscriber = Subscriber.new # From the mongo driver: # # > Global subscriptions must be established prior to creating # > clients. When a client is constructed it copies subscribers from # > the Global module; subsequent subscriptions or unsubscriptions # > on the Global module have no effect on already created clients. # # So, for existing clients created before the Skylight initializer # runs, we'll have to subscribe to those individually. ::Mongoid::Clients.clients.each { |_name, client| client.subscribe(::Mongo::Monitoring::COMMAND, subscriber) } ::Mongo::Monitoring::Global.subscribe(::Mongo::Monitoring::COMMAND, subscriber) end |