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
-
#awaited? ⇒ true | false
Whether the heartbeat was awaited.
-
#initialize(address, topology, previous_description, new_description, awaited: false) ⇒ ServerDescriptionChanged
constructor
private
Create the event.
-
#summary ⇒ String
Returns a concise yet useful summary of the event.
Constructor Details
#initialize(address, topology, previous_description, new_description, awaited: false) ⇒ ServerDescriptionChanged
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.
Create the event.
62 63 64 65 66 67 68 69 70 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 62 def initialize(address, topology, previous_description, new_description, awaited: false ) @address = address @topology = topology @previous_description = previous_description @new_description = new_description @awaited = !!awaited end |
Instance Attribute Details
#address ⇒ Address (readonly)
Returns address The server address.
28 29 30 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 28 def address @address end |
#new_description ⇒ Server::Description (readonly)
Returns new_description The new server description.
39 40 41 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 39 def new_description @new_description end |
#previous_description ⇒ Server::Description (readonly)
Returns previous_description The previous server description.
35 36 37 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 35 def previous_description @previous_description end |
#topology ⇒ Topology (readonly)
Returns topology The topology.
31 32 33 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 31 def topology @topology end |
Instance Method Details
#awaited? ⇒ true | false
Returns Whether the heartbeat was awaited.
44 45 46 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 44 def awaited? @awaited end |
#summary ⇒ String
This method is experimental and subject to change.
Returns a concise yet useful summary of the event.
80 81 82 83 84 85 |
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 80 def summary "#<#{short_class_name}" + " address=#{address}" + # TODO Add summaries to descriptions and use them here " prev=#{previous_description.server_type.upcase} new=#{new_description.server_type.upcase}#{awaited_indicator}>" end |