123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongo::Event::Base
Defined in: lib/mongo/monitoring/event/server_description_changed.rb

Overview

::Mongo::Monitoring::Event fired when a server’s description changes.

Since:

  • 2.4.0

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::Mongo::Event::Base - Inherited

#summary

Returns a concise yet useful summary of the event.

#short_class_name

Instance Attribute Details

#addressAddress (readonly)

Returns:

  • (Address)

    address The server address.

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 28

attr_reader :address

#awaited?true | false (readonly)

Returns:

  • (true | false)

    Whether the heartbeat was awaited.

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 44

def awaited?
  @awaited
end

#new_descriptionServer::Description (readonly)

Returns:

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 39

attr_reader :new_description

#previous_descriptionServer::Description (readonly)

Returns:

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 35

attr_reader :previous_description

#topologyTopology (readonly)

Returns:

  • (Topology)

    topology The topology.

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 31

attr_reader :topology

Instance Method Details

#awaited_indicator (private)

Since:

  • 2.4.0

[ GitHub ]

  
# File 'lib/mongo/monitoring/event/server_description_changed.rb', line 89

def awaited_indicator
  if awaited?
    ' [awaited]'
  else
    ''
  end
end

#summaryString

Note:

This method is experimental and subject to change.

Returns a concise yet useful summary of the event.

Returns:

  • (String)

    String summary of the event.

Since:

  • 2.7.0

[ GitHub ]

  
# 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