ServerDescriptionChanged — Documentation by YARD 0.9.37 (original) (raw)

Class: Mongo::Monitoring::Event::ServerDescriptionChanged

Inherits:

Event::Base

Defined in:

lib/mongo/monitoring/event/server_description_changed.rb

Overview

Event fired when a server’s description changes.

Instance Attribute Summary collapse

Instance Method Summarycollapse

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

#addressAddress

Returns address The server address.

28 29 30 # File 'lib/mongo/monitoring/event/server_description_changed.rb', line 28 def address @address end

#new_descriptionServer::Description

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_descriptionServer::Description

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

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

Note:

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}" + " prev=#{previous_description.server_type.upcase} new=#{new_description.server_type.upcase}#{awaited_indicator}>" end