Class: Mongo::Monitoring::Event::TopologyChanged

Inherits:
Event::Base
  • Object
show all
Defined in:
build/ruby-driver-master/lib/mongo/monitoring/event/topology_changed.rb

Overview

Event fired when the topology changes.

Since:

  • 2.4.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(previous_topology, new_topology) ⇒ TopologyChanged

Create the event.

Examples:

Create the event.

TopologyChanged.new(previous, new)

Parameters:

Since:

  • 2.4.0



42
43
44
45
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/topology_changed.rb', line 42

def initialize(previous_topology, new_topology)
  @previous_topology = previous_topology
  @new_topology = new_topology
end

Instance Attribute Details

#new_topologyCluster::Topology (readonly)

Returns new_topology The new topology.

Returns:

Since:

  • 2.4.0



31
32
33
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/topology_changed.rb', line 31

def new_topology
  @new_topology
end

#previous_topologyCluster::Topology (readonly)

Returns previous_topology The previous topology.

Returns:

Since:

  • 2.4.0



28
29
30
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/topology_changed.rb', line 28

def previous_topology
  @previous_topology
end

Instance Method Details

#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



55
56
57
58
59
# File 'build/ruby-driver-master/lib/mongo/monitoring/event/topology_changed.rb', line 55

def summary
  "#<#{short_class_name}" +
  " prev=#{previous_topology.summary}" +
  " new=#{new_topology.summary}>"
end