class Mongo::Monitoring::Event::ServerDescriptionChanged
Event fired when a server's description changes.
@since 2.4.0
Attributes
@return [ Address ] address The server address.
@return [ Server::Description ] #new_description The new server
description.
@return [ Server::Description ] #previous_description The previous server
description.
@return [ Topology ] topology The topology.
Public Class Methods
Create the event.
@example Create the event.
ServerDescriptionChanged.new(address, topology, previous, new)
@param [ Address ] address The server address. @param [ Integer ] topology The topology. @param [ Server::Description ] #previous_description The previous description. @param [ Server::Description ] #new_description The new description. @param [ true | false ] awaited Whether the server description was
a result of processing an awaited hello response.
@since 2.4.0 @api private
# File lib/mongo/monitoring/event/server_description_changed.rb, line 61 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
Public Instance Methods
@return [ true | false ] Whether the heartbeat was awaited.
@api experimental
# File lib/mongo/monitoring/event/server_description_changed.rb, line 43 def awaited? @awaited end
Returns a concise yet useful summary of the event.
@return [ String ] String summary of the event.
@note This method is experimental and subject to change.
@since 2.7.0 @api experimental
# File lib/mongo/monitoring/event/server_description_changed.rb, line 79 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
Private Instance Methods
# File lib/mongo/monitoring/event/server_description_changed.rb, line 88 def awaited_indicator if awaited? ' [awaited]' else '' end end