Class: Mongo::Monitoring::Event::ServerDescriptionChanged
- Inherits:
-
Event::Base
- Object
- Event::Base
- Mongo::Monitoring::Event::ServerDescriptionChanged
- Defined in:
- lib/mongo/monitoring/event/server_description_changed.rb
Overview
Event fired when a server’s description changes.
Instance Attribute Summary collapse
-
#address ⇒ Address
readonly
Address The server address.
-
#new_description ⇒ Server::Description
readonly
New_description The new server description.
-
#previous_description ⇒ Server::Description
readonly
Previous_description The previous server description.
-
#topology ⇒ Topology
readonly
Topology The topology.
Instance Method Summary collapse
-
#initialize(address, topology, previous_description, new_description) ⇒ ServerDescriptionChanged
constructor
Create the event.
-
#summary ⇒ String
Returns a concise yet useful summary of the event.
Constructor Details
#initialize(address, topology, previous_description, new_description) ⇒ ServerDescriptionChanged
Create the event.
49 50 51 52 53 54 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 49 def initialize(address, topology, previous_description, new_description) @address = address @topology = topology @previous_description = previous_description @new_description = new_description end |
Instance Attribute Details
#address ⇒ Address (readonly)
Returns address The server address.
25 26 27 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 25 def address @address end |
#new_description ⇒ Server::Description (readonly)
Returns new_description The new server description.
36 37 38 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 36 def new_description @new_description end |
#previous_description ⇒ Server::Description (readonly)
Returns previous_description The previous server description.
32 33 34 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 32 def previous_description @previous_description end |
#topology ⇒ Topology (readonly)
Returns topology The topology.
28 29 30 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 28 def topology @topology end |
Instance Method Details
#summary ⇒ String
Note:
This method is experimental and subject to change.
Returns a concise yet useful summary of the event.
64 65 66 67 68 69 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 64 def summary "#<#{self.class.name.sub(/^Mongo::Monitoring::Event::/, '')}" + " address=#{address} topology=#{topology.summary}" + # TODO Add summaries to descriptions and use them here " prev=#{previous_description.inspect} new=#{new_description.inspect}>" end |